DashboardScreen._poll is declared @work(thread=True, exclusive=True, group="poll") (src/bmad_loop/tui/screens/dashboard.py:746). The exclusive=True
plus group="poll" pair is load-bearing: it is what makes an arriving poll cancel
an in-flight one instead of letting two threads feed ctx.log's pyte stream
concurrently.
Nothing in the suite asserts that decoration.
How it got here
test_poll_skips_while_another_holds_the_lock used to call screen._poll(...)
directly, so it ran through the decorator. PR #663 changed it to invoke
DashboardScreen._poll.__wrapped__ inside a private worker group, because the
decorated form was exactly what made the test flaky — an interval tick landing
between the hand-started worker and await worker.wait() cancelled the test's own
worker via cancel_group(node, group), raising WorkerCancelled on slow Windows
runners.
That coverage was never real in the old form either (the decorator was the thing
breaking the test, not a thing it verified), and the PR states the loss honestly in
its commit body. But the gap is now unpinned in both directions.
Suggested shape
A one-line seam assertion is enough — read the decoration off the class attribute
and assert exclusive and the group name, so a refactor that drops either one
fails a test rather than silently re-admitting concurrent polls. Sizing it
correctly means checking what textual's @work actually exposes on the wrapper in
the pinned version (>=8.0,<9) rather than assuming a public accessor exists.
Low priority — the behavior is exercised incidentally by every other test that
ticks the dashboard; what is missing is a direct, named guard.
DashboardScreen._pollis declared@work(thread=True, exclusive=True, group="poll")(src/bmad_loop/tui/screens/dashboard.py:746). Theexclusive=Trueplus
group="poll"pair is load-bearing: it is what makes an arriving poll cancelan in-flight one instead of letting two threads feed
ctx.log's pyte streamconcurrently.
Nothing in the suite asserts that decoration.
How it got here
test_poll_skips_while_another_holds_the_lockused to callscreen._poll(...)directly, so it ran through the decorator. PR #663 changed it to invoke
DashboardScreen._poll.__wrapped__inside a private worker group, because thedecorated form was exactly what made the test flaky — an interval tick landing
between the hand-started worker and
await worker.wait()cancelled the test's ownworker via
cancel_group(node, group), raisingWorkerCancelledon slow Windowsrunners.
That coverage was never real in the old form either (the decorator was the thing
breaking the test, not a thing it verified), and the PR states the loss honestly in
its commit body. But the gap is now unpinned in both directions.
Suggested shape
A one-line seam assertion is enough — read the decoration off the class attribute
and assert
exclusiveand the group name, so a refactor that drops either onefails a test rather than silently re-admitting concurrent polls. Sizing it
correctly means checking what textual's
@workactually exposes on the wrapper inthe pinned version (
>=8.0,<9) rather than assuming a public accessor exists.Low priority — the behavior is exercised incidentally by every other test that
ticks the dashboard; what is missing is a direct, named guard.