rerun-fails: detect parent-test runtime.Goexit as incomplete run - #566
rerun-fails: detect parent-test runtime.Goexit as incomplete run#566chandler-solo wants to merge 2 commits into
Conversation
Avoids false green. Reruns only rerun known tests, and such panics prevent the full list of tests from ever becoming known. Signed-off-by: David L. Chandler <david.chandler@solo.io>
Signed-off-by: David L. Chandler <david.chandler@solo.io>
|
The fix blocks the real parent- I reproduced this on Go 1.26.5 with the PR binary. A test that logs the fragment, fails once via a marker file, and passes on rerun behaves as follows: func TestLoggedText(t *testing.T) {
t.Log("test executed panic(nil) or runtime.Goexit")
if _, err := os.Stat("first-run"); err == nil {
return
}
if err := os.WriteFile("first-run", nil, 0o600); err != nil {
t.Fatal(err)
}
t.Fail()
}With gotestsum v1.13.0, The real Go 1.24–1.26 diagnostic includes the complete suffix: and is emitted from I also ran the original parent- DisclosureInvestigated thoroughly with openai-codex/gpt-5.6-sol (medium reasoning effort), using Oh My Pi as the agent framework. This report is not generic or unreviewed AI-generated output. Its claims were checked against the cited evidence, and it includes the relevant detail intended to help maintainers resolve the issue. If reports like this are not useful to the project, please let me know and I will refrain from submitting similar ones. My intent is to help without wasting maintainer time or energy or discouraging their work. Thank you for your work. |
Summary
Treat Go's parent-test
runtime.Goexitdiagnostic as an incomplete test run when using--rerun-fails.If a subtest calls
FailNow/Fatalon a parent*testing.T, Go emits:test executed panic(nil) or runtime.Goexit: subtest may have called FailNow on a parent testThat can abort the rest of the test branch, so some tests may never run. In that state, rerunning only the observed failed tests is unsafe because gotestsum can report success after the rerun passes while skipped sibling tests were never executed.
Fixes #565
Changes
runtime.Goexitdiagnostic alongside existing suspected panic detection.runtime.Goexitcase.Testing