Repository navigation
fix(go): prevent double-counted failures when test-level fail also triggers package-level fail (#958) - #1220
Merged
Merged
Conversation
Collaborator
📊 Automated PR Analysis
SummaryFixes double-counting of test failures in the Go test filter. When Review Checklist
Linked issues: #958 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
…cades from test failures (#958) go test -json emits both a test-level {"action":"fail","Test":"..."} and a trailing package-level {"action":"fail"} (no Test field) for every failing test. The parser was counting both events, so a run with 1 failing test was reported as "2 failed" in the summary header. Fix: total_pkg_fail now only includes packages where package_failed is true AND there are no individual test- or build-level failures — i.e. pure package-level failures such as timeouts and panics. Also exclude such packages from the [FAIL] display section when test-level results are already shown below. Three new tests cover: - no double-count on a regular test failure - exact reproduction from issue #958 (signal: quit line) - timeout with passing tests before the kill Generated by Claude Code Vibe coded by ousamabenyounes Co-Authored-By: Claude <[email protected]>
pszymkowiak
approved these changes
Apr 12, 2026
pszymkowiak
left a comment
Collaborator
There was a problem hiding this comment.
LGTM — fix is correct and minimal.
total_pkg_failnow correctly excludes cascade events (packages with test-level or build failures already counted)- Display section skips duplicate
[FAIL]blocks for the same reason - 3 solid edge-case tests covering: double-count, exact #958 reproduction (signal: quit), and mixed pass+timeout
- All 65 go_cmd tests pass, no regression
- CI green across macOS/Linux/Windows
Merged
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
fix(go): prevent double-counted failures when test-level fail also triggers package-level fail (rtk-ai#958)
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
fix(go): prevent double-counted failures when test-level fail also triggers package-level fail (rtk-ai#958)
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
Fixes #958
go test -jsonalways emits a trailing package-level{"action":"fail"}after each test-level failure (noTestfield). The previous code counted both events, so a run with 1 failing test showed "2 failed" in the summary header.[FAIL]block and again in the per-package test results section.total_pkg_failnow only includes packages wherepackage_failed=trueand there are no individual test- or build-level failures — i.e. pure package-level failures (timeouts, signals, panics). The[FAIL]display section skips packages that already have test-level results below.Test plan
cargo fmt --all && cargo clippy --all-targets && cargo test— 1376 passed, 0 failedtest_filter_go_test_no_double_count_on_test_failure— verifies header says "1 failed" not "2 failed" for a single failing testtest_filter_go_test_timeout_with_signal_quit_output— exact reproduction from issue go test timeout reported as 'No tests found' with exit code 0 #958 (signal: quit line present)test_filter_go_test_timeout_with_passing_tests_before_kill— mixed case: some tests pass before package is killed by timeoutFiles changed
src/cmds/go/go_cmd.rsCHANGELOG.mdGenerated by Ora Studio
Vibe coded by ousamabenyounes