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
fix(cli): ensure that pre- and post-test output is flushed at the appropriate times #22611
Conversation
442446e
to
20de3f4
Compare
#[tokio::test] | ||
async fn websocket_server_idletimeout() { | ||
test_util::timeout!(60); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was using deno test
to bypass a hang, but that stopped working with this change. I (mostly) fixed the test by just forcing an exit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
tests/testdata/test/load_unload.out
Outdated
----- output end ----- | ||
test ... ok ([WILDCARD]) | ||
------- post-test output ------- | ||
unload | ||
----- output end ----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit confusing - we have output end
two end. Is this actually expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output end
matches with post-test output
.
Maybe I can clarify this by making the pairs ------- post-test output -------
and ------- post-test output end -------
instead. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be less confusing, so +1 from me
63c3dfc
to
c60c4eb
Compare
Some
deno_std
tests were failing to print output that was resolved after the last test finished. In addition, output printed before tests began would sometimes appear above the "running X tests ..." line, and sometimes below it depending on timing.We now guarantee that all output is flushed before and after tests run, making the output consistent.
Pre-test and post-test output are captured in
------ pre-test output ------
and------ post-test output ------
blocks to differentiate them from the regular output blocks.Here's an example of a test (that is much noisier than normal, but an example of what the output will look like):