Repository navigation
Deflake certificate-shim controller register tests - #9254
cert-manager-prow[bot] merged 2 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
/kind flake |
|
/release-note-none |
|
/retest |
The ingresses test shut its workqueue down on a fixed 50ms timer, so on a loaded CI node the shared informers had not always delivered the expected event before the queue was drained. Shut the queue down shortly after the expected key arrives instead, with a generous backstop so a broken handler fails rather than hangs. The gateways and listenerset sibling tests had the same fixed 50ms window, and both read the mock workqueue's callsToAdd slice while the informer goroutines were still appending to it -- a data race that go test -race catches in the listenerset package. Guard the mock with a mutex, and wait generously for the expected Add calls before the final assertion. Fixes cert-manager#9249 Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Richard Wall <[email protected]>
|
The EvidenceAll 70 failed specs in the build log are ACME conformance tests (HTTP01 and DNS01), and every one timed out at the 600s spec limit. Nothing outside the ACME suites failed, so the ACME test environment broke for that whole run. The sibling job /retest [Claude Fable 5] |
The parent-Gateway case waited only 2 seconds for the lister to see ls-3. A loaded CI node can take longer to deliver the Add event, which fails the test although the controller is correct. Use wait.ForeverTestTimeout, as the other waits in this test do. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: Richard Wall <[email protected]>
93cb1e7 to
2d47bd7
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lunarwhite, wallrj The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #9249
The
Test_controller_Registertest inpkg/controller/certificate-shim/ingressesshut its workqueue down on a fixed 50ms timer, so on a loaded CI node the shared informers had not always delivered the expected event before the queue was drained (seen on #9211). The queue is now shut down shortly after the expected key arrives — the short delay only exists to catch unexpected extra keys — withwait.ForeverTestTimeoutas a backstop so a broken handler fails the test rather than hanging it. The timer dated from #4149.While verifying the fix with
go test -race -count=20 ./pkg/controller/certificate-shim/..., the race detector flagged the siblinglistenersettest (added in #8394): it polls the mock workqueue'scallsToAddslice while the informer goroutines are still appending to it. Thegatewaystest has the same unsynchronised read plus its own fixed 50ms sleep before asserting. Both siblings now guard the mock with a mutex, wait generously for the expectedAddcalls to arrive, and only then apply the original short grace period for unexpected extras.The
listenersettest keeps itsSubsetassertion rather than an exact comparison: the order ofAddcalls across different informers is not deterministic, and a late GatewayAddedevent can legitimately enqueue a duplicate key via the parent index (controller.go#L89-L110).Verified with
go test -race -count=20on all three packages:ingresses,gatewaysandlistenersetall pass.with claude fable-5