mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Remove flaky tiktoken test (#3113)
This commit is contained in:
parent
6a6443e648
commit
f813ed850b
1 changed files with 0 additions and 14 deletions
|
|
@ -119,24 +119,10 @@ describe("tiktoken", () => {
|
|||
|
||||
const content: Anthropic.Messages.ContentBlockParam[] = [{ type: "text", text: "Hello world" }]
|
||||
|
||||
// Time the first call which should create the encoder
|
||||
const startTime1 = performance.now()
|
||||
const result1 = await tiktoken(content)
|
||||
const endTime1 = performance.now()
|
||||
const duration1 = endTime1 - startTime1
|
||||
|
||||
// Time the second call which should reuse the encoder
|
||||
const startTime2 = performance.now()
|
||||
const result2 = await tiktoken(content)
|
||||
const endTime2 = performance.now()
|
||||
const duration2 = endTime2 - startTime2
|
||||
|
||||
// Both calls should return the same token count
|
||||
expect(result1).toBe(result2)
|
||||
|
||||
// This is a loose test and might occasionally fail due to system load,
|
||||
// but generally the second call should be faster or similar in speed
|
||||
// since it reuses the encoder
|
||||
expect(duration2).toBeLessThanOrEqual(duration1 * 1.5)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue