Skip to content

tests: asahi: synchronize tbnet refill-worker teardown checks - #205

Merged
maralcbr merged 1 commit into
integration/aurorafrom
fix/tbnet-refill-fixture-sync-20261024
Oct 28, 2026
Merged

maralcbr merged 1 commit into
integration/aurorafrom
fix/tbnet-refill-fixture-sync-20261024

Conversation

@chriskearney

Copy link
Copy Markdown

The merge-queue run for #202 failed retry-running-teardown at 16 KiB pages, while the build, KUnit and QEMU boot passed. This fixture and the Thunderbolt driver are unchanged by #202. The control sleeps 30 ms and then assumes the stop thread has reached cancellation; delaying that thread by 100 ms reproduces an assertion failure before teardown runs.

Wait for the fixture's cancellation event under its mutex, with a two-second deadline, then check that rings and the page pool remain intact. This also removes the unlocked cancel_waiting read. No production driver or CI acceptance-rule changes.

Validation:

  • All 44 controls pass at both 4 KiB and 16 KiB pages, before and after the focused mutation run.
  • The repaired control passes with deliberate 100 ms and 250 ms teardown-thread delays at both page sizes; 200 repeated controls pass.
  • Removing production cancellation still aborts the focused control at both page sizes. checkpatch --strict reports no findings on the code diff.

Failing merge-queue job. The CI log identifies the case and SIGABRT; the scheduling-delay reproduction above is local evidence, not a captured CI stack trace. Implementation and validation assisted by Codex.

retry-running-teardown assumes its stop thread has entered cancellation
within a fixed 30 ms sleep. If the thread is not scheduled in that window,
the control aborts before teardown runs. It also reads cancel_waiting
without the fixture mutex.

Broadcast the fixture condition when cancellation starts and wait for
that event under the mutex, with a bounded two-second deadline. Keep the
retry worker paused until the teardown assertions have run. A missing
cancel still fails rather than timing out the entire suite.

Fixes: 71700a1 ("net: thunderbolt: retry receive refill after allocation failure")
Signed-off-by: Chris Kearney <303316+chriskearney@users.noreply.github.com>
Generated-by: LLM
@chriskearney
chriskearney marked this pull request as ready for review October 24, 2026 18:15
@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; it removes the scheduling assumption without weakening the teardown checks.

Summary

The PR replaces the fixed sleep in retry-running-teardown with a bounded wait for cancellation.

  • The refill teardown control waits for cancellation before checking rings and the page pool.

Reviews (1) · Last reviewed commit: "tests: asahi: synchronize tbnet refill-w..." · Reviewed by Greptile

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chriskearney looks right. The old control slept 30 ms and then read cancel_waiting without gate, so a slow stop thread failed the assert before teardown ran. Now cancel_delayed_work_sync() sets cancel_waiting and broadcasts cv while holding gate (tbnet-refill-fixture.h:96-106), and wait_cancel() waits for that flag under the same mutex (tbnet-refill-tests.py:59-70). So the check runs exactly when the old test meant it to: cancel has started, the paused worker is still holding up teardown, and ring_stops == 0 && pool_destroy_calls == 0.

The extra broadcast is harmless, because every other waiter on cv loops on its own condition. A missing cancel now fails at the two-second deadline, before the runner's five-second per-case timeout. The Fixes: target, 71700a1, is the commit that added this control. The other usleep controls (:94, :104-105) still use a fixed sleep. If one of them flakes, it can get the same treatment.

Approving.

@maralcbr
maralcbr added this pull request to the merge queue Oct 28, 2026
Merged via the queue into integration/aurora with commit b9d340b Oct 28, 2026
19 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants