testrunner: don't mask a parent test that fails on its own#5698
testrunner: don't mask a parent test that fails on its own#5698pietern wants to merge 2 commits into
Conversation
A known-failure rule names a specific subtest, but a parent test also fails whenever one of its subtests fails. The runner allowed the parent to fail by matching rules bidirectionally: a rule whose pattern was a descendant of the failing test also matched. That allowance was unconditional, so the top-level TestAccept failing on its own (before any subtest ran) matched any TestAccept/... rule and was silently swallowed. Move parent-cascade handling out of rule matching and into failure analysis: matches() reverts to plain forward matching, and a failure is allowed when a rule matches or a subtest of it also failed. Go reports a parent's failure only after its subtests, so the failing subtest is already recorded when the parent is evaluated. Co-authored-by: Isaac
| if unexpectedFailures[key] { | ||
| fmt.Printf("%s %s passed on retry\n", result.Package, result.Test) | ||
| delete(unexpectedFailures, key) | ||
| } |
There was a problem hiding this comment.
we can do this, although a bit hard to see what's going.
Alternative, possibly simpler is to place all the version checks into dedicated subtest so it's not just TestAccept that fails but TestAccept/min-versions
There was a problem hiding this comment.
^ we should probably do it regardless, much better to see that it's TestAccept/min-versions having issues rather than TestAccept which tells nothing.
There was a problem hiding this comment.
We can move it into a subtest for clarity and -run filtering, not as a replacement for this change.
The ancestor of a "acceptable failure" failing without the entry itself failing must never be allowed.
Made the subtest change here: #5712
There was a problem hiding this comment.
I agree it should not. I've always thought of TestAccept as empty shell that cannot fail as everything is in subtests (I think this was the first case it did) but if it does fail, the consequences are not great, so worth extra safety.
Integration test reportCommit: aaead19
23 interesting tests: 13 SKIP, 7 KNOWN, 2 flaky, 1 RECOVERED
Top 5 slowest tests (at least 2 minutes):
|
Summary
The integration test runner masks failures listed in
known_failures.txt. A known-failure rule names a specific subtest (e.g.TestAccept/ssh/connection), but a parent test also fails whenever one of its subtests fails, so the runner additionally allowed the parent to fail. It did this by matching a rule against the parent bidirectionally: a rule whose pattern was a descendant of the failing test also matched.That allowance was unconditional. When the top-level
TestAcceptfailed on its own — before any subtest ran — its failure still matched anyTestAccept/...rule and was silently swallowed. The recentRequireRuffsetup check (#5662) does exactly this on the integration runners (ruff isn't installed there), soTestAccepthas been failing on every environment while the nightly reports green.This moves the parent-cascade handling out of rule matching and into failure analysis:
ConfigRule.matchesreverts to plain forward matching — a rule matches a test or its subtree, nothing about parents.checkFailuresallows a failure when a rule matches or a subtest of it also failed. Go reports a parent's failure only after its subtests, so the failing subtest is already recorded when the parent is evaluated; no second pass is needed.Net effect: a parent failing because of a (known or unknown) subtest is still not double-counted, but a test that fails on its own with no failing subtest now surfaces as unexpected.
This only makes the failure visible. Installing ruff on the integration runners is handled separately.
Tests
TestCheckFailuresexercisescheckFailuresend-to-end: parent-with-failing-subtest (allowed), parent-alone (the ruff case, surfaced), unlisted failure (surfaced), and fail-then-pass-on-retry (allowed).TestConfigRuleMatchesreverse-match cases now assert that a rule does not match a parent of the listed test.This pull request and its description were written by Isaac.