Repository navigation
test(reporter): drive the deferred-warning rules on a local buffer - #1345
Merged
Merged
Conversation
deferred_warnings_are_capped failed on Windows CI (#1275, run 42856901338) because it asserted on the process-global DEFERRED buffer. Its test lock only serialised the two reporter tests; any TUI test marks the terminal owned, and a warn() raised on another test thread during that window lands in the same buffer (or a TUI exit flushes it mid-assertion). Split the dedupe-and-cap rule into push_deferred(&mut Vec, ..) so the counting and cap tests use a local Vec, and keep one global-buffer test that only asserts on its own uniquely named entry after a flush. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
util::reporter::tests::deferred_warnings_are_cappedfailed on Windows in run 42856901338 (#1275, which does not touch the reporter). The test asserted on the process-globalDEFERREDbuffer. ItsDEFERRED_TEST_LOCKonly serialised the two reporter tests against each other. Any TUI test marks the terminal owned, and awarn()raised on another test thread in that window lands in the same buffer. A TUI exit can also flush the buffer partway through the assertion.deferintopush_deferred(&mut Vec, ..). Runtime behaviour is unchanged.push_deferredon a localVec, so no other thread can affect them.flushing_drains_deferred_warnings. It still uses the global buffer, but only asserts that its own uniquely named entry is gone after a flush.DEFERRED_TEST_LOCK, which is no longer needed.Test-only change, so
release/skip.Validation
cargo fmt --all: no changes.cargo test: all suites pass (1891 unit tests, 6 ignored).cargo clippy --all-targets --all-features: no warnings inreporter.rs.🤖 Generated with Claude Code