Skip to content
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

bun test timeouts are not accurate on Mac and Windows #8913

Open
paperdave opened this issue Feb 15, 2024 · 2 comments
Open

bun test timeouts are not accurate on Mac and Windows #8913

paperdave opened this issue Feb 15, 2024 · 2 comments
Labels
bug Something isn't working jest Something related to the `bun test` runner macOS An issue that only occurs on macOS windows An issue that only occurs on Windows

Comments

@paperdave
Copy link
Collaborator

What version of Bun is running?

No response

What platform is your computer?

No response

What steps can reproduce the bug?

try something like

import { test, expect } from "bun:test";
import { sleep } from "bun";
test("timeout", async () => {
  await sleep(5001);
});

What is the expected behavior?

the test ALWAYS fails because it takes longer than 5 seconds

What do you see instead?

image

the test took longer than five seconds, but it passed???? execution, even a nanosecond, should not be longer than the timeout.

Additional information

CI reproduces this after we moved a time like 5001 to 5010 to workaround this bug. the real issue is that the test timeouts are not accurate.

@paperdave paperdave added bug Something isn't working jest Something related to the `bun test` runner labels Feb 15, 2024
@paperdave paperdave changed the title bun test timeouts are not accurate bun test timeouts are not accurate on Mac and Windows Feb 15, 2024
@paperdave paperdave added windows An issue that only occurs on Windows macOS An issue that only occurs on macOS labels Feb 15, 2024
@Jarred-Sumner
Copy link
Collaborator

image

It's not 100% precise and it ends up waiting longer than it should but i'm pretty sure this is more of a windows bug

@paperdave
Copy link
Collaborator Author

cannot reproduce this on linux, but can on mac and windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jest Something related to the `bun test` runner macOS An issue that only occurs on macOS windows An issue that only occurs on Windows
Projects
None yet
Development

No branches or pull requests

2 participants