Skip to content

Commit afabe70

Browse files
committed
Remove flaky tiktoken test
1 parent 6a6443e commit afabe70

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/utils/__tests__/tiktoken.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,24 +119,10 @@ describe("tiktoken", () => {
119119

120120
const content: Anthropic.Messages.ContentBlockParam[] = [{ type: "text", text: "Hello world" }]
121121

122-
// Time the first call which should create the encoder
123-
const startTime1 = performance.now()
124122
const result1 = await tiktoken(content)
125-
const endTime1 = performance.now()
126-
const duration1 = endTime1 - startTime1
127-
128-
// Time the second call which should reuse the encoder
129-
const startTime2 = performance.now()
130123
const result2 = await tiktoken(content)
131-
const endTime2 = performance.now()
132-
const duration2 = endTime2 - startTime2
133124

134125
// Both calls should return the same token count
135126
expect(result1).toBe(result2)
136-
137-
// This is a loose test and might occasionally fail due to system load,
138-
// but generally the second call should be faster or similar in speed
139-
// since it reuses the encoder
140-
expect(duration2).toBeLessThanOrEqual(duration1 * 1.5)
141127
})
142128
})

0 commit comments

Comments
 (0)