8000 Remove flaky tiktoken test by mrubens · Pull Request #3113 · RooVetGit/Roo-Code · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove flaky tiktoken test #3113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/utils/__tests__/tiktoken.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
0