-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Nondeterministic deno test
output with Deno.exit()
#25881
Comments
deno test
outputdeno test
output with Deno.exit()
This is raciness in thread synchronisation. When you |
I don't think it's in the JS. I can also reproduce it by adding some log statements in the rust code in this method, but only when I have an deno/cli/tools/test/reporters/pretty.rs Line 215 in 88a4f8d
Added this into the method: eprintln!("write: {}", format!("------- foo output -------")); ![]() If I do just this: eprintln!("write: foo"); Then the output is correct. ![]() There definitely seems to be a race condition somewhere like you suggested, but it feels more like somewhere from Rust to me. |
We should probably fix this by intercepting top level |
Running the following minimal reproduction code with
deno test
will not output theconsole.error
message most of the time:This is a problem in real-life scenarios when tests should be aborted if setup conditions are not met.
Running it with
deno run
will output the message correctly:I've looked at the documentation for Deno.exit() but don't see anything about leaks, and the test Sanitizers don't mention
console
.The text was updated successfully, but these errors were encountered: