Uh oh!
There was an error while loading. Please reload this page.
fix(runner): capture parallel worker stderr instead of discarding it - #891
Merged
Conversation
Each file worker was spawned as `call_test_functions … 2>/dev/null &` since #358, to keep worker noise off the progress line. That also made the same run report differently depending on --parallel. The worker's stderr is now redirected to a per-file capture under the run output dir and rendered after aggregation as a `Stderr from <file>` block. The capture cannot live under TEMP_DIR_PARALLEL_TEST_SUITE: state::aggregate_parallel_results walks every entry there and would report "No tests found" for a stray file. Cleanup is the existing run-dir EXIT trap, so no per-file `rm` fork is added. Scope note: a test *body*'s stderr was never lost. execute_test_body runs the function as `"$fn_name" "$@" 2>&1`, so it is merged into the captured stdout and already surfaced in that test's failure block. What the redirect dropped is stderr with no owning test — data providers, hook plumbing, scratch-dir errors — which is why the new block is attributed to the file rather than to a test. The regression test compares occurrence counts between modes rather than just grepping for the message: the fixture's provider also runs in the main-shell counting pass, so the diagnostic leaks in either way and a bare assert_contains passes against the unfixed code. Closes#864
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 freeto 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.
🤔 Background
Related #864
Each parallel file worker was spawned as
call_test_functions … 2>/dev/null &(added in #358 to keep worker noise off the progress line), so the same run could report differently depending on--parallel, with nothing indicating output had been suppressed.💡 Changes
Stderr from <file>block, so data-provider diagnostics, hook-plumbing messages and scratch-dir errors survive. Cleanup rides the existing run-dir EXIT trap, so no per-filermfork is added.TEMP_DIR_PARALLEL_TEST_SUITE:state::aggregate_parallel_resultswalks every entry there and a stray file makes it report "No tests found".execute_test_bodyruns the function as"$fn_name" "$@" 2>&1, so it is merged into the captured stdout and already appeared in that test's failure block. What the redirect dropped is stderr with no owning test, which is why the new block is attributed to the file rather than to a test.assert_containspasses against the unfixed code.