Skip to content

test(agents): pause the status poll around the failed-Stop checks - #431

Merged
wesbillman merged 2 commits into
mainfrom
pinky/agent-control-stop-poll-race
Sep 29, 2026
Merged

wesbillman merged 2 commits into
mainfrom
pinky/agent-control-stop-poll-race

Conversation

@wesbillman

@wesbillman wesbillman commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes an intermittent WebKit failure in unreadable status allows only explicit Stop from a retained running snapshot (failed run on #428): expected "Could not confirm", received "Could not refresh local agents".

Cause: useAgentControlRefresh polls every 5 s. In this test the fixture snapshot keeps throwing, so a poll tick that lands after the failed Stop replaces its error with "Could not refresh". The same class of race exists later: a successful poll after restoreStore() can recover the agent before the explicit retry Stop, disabling that button.

Fix (test-only, +6 lines): install Playwright's clock at a fixed instant before the page mounts and pauseAt a fixed hour later before the failed Stop, so from there only the test's explicit actions read or write. This follows agent-models.spec.mjs, which uses the same pattern on the same fixture. No assertions are removed or relaxed, and product code is unchanged.

Validation

  • Mutation at 22cb4748, poll forced to 20 ms (temporary edit to control-react.ts, reverted):
    • Without the fix: 8/8 failed on Chromium + WebKit (--repeat-each 2), on the same Stop-guidance assertion.
    • With the fix: 12/12 passed (--repeat-each 3).
    • Pausing only for the first assertion and resuming before the retry: the retry stop.click() timed out (the second race).
  • Real 5 s poll, at 22cb4748 and again at e2cf7276 (fixed clock instants): full tests/browser/agent-control.spec.mjs passed on Chromium + WebKit (28/28).

Gap: a green run doesn't prove there are no other flakes. Hosted CI is pending.

Note (unchanged product behaviour, not in scope): in the app, a failing poll still replaces the Stop failure's detailed guidance with "Could not refresh" within about 5 s.

Pinky added 2 commits September 29, 2026 15:11
The unreadable-status Stop test could lose "Could not confirm" to the
five-second status poll, whose failing snapshot replaces it with "Could
not refresh local agents". A poll after restoring the host could also
recover the agent before the explicit retry Stop.

Install Playwright's clock before the page mounts and pause it before the
failed Stop, so only the test's explicit actions read or write from there.

Signed-off-by: Pinky <5f5ab050ec58ae208332edd544ebf705221e24c1b86d82a6ca07038a7a8f6ac9@buzz.block.builderlab.xyz>
Match agent-models.spec.mjs: a pause target derived from page time can
already be past if CI stalls between reading and pausing the clock.

Signed-off-by: Pinky <5f5ab050ec58ae208332edd544ebf705221e24c1b86d82a6ca07038a7a8f6ac9@buzz.block.builderlab.xyz>
@wesbillman
wesbillman marked this pull request as ready for review September 29, 2026 21:17
@wesbillman
wesbillman requested review from a team and comp615 as code owners September 29, 2026 21:17
@wesbillman
wesbillman merged commit 972515c into main Sep 29, 2026
20 checks passed
@wesbillman
wesbillman deleted the pinky/agent-control-stop-poll-race branch September 29, 2026 21:29
johnmatthewtennant pushed a commit that referenced this pull request Sep 29, 2026
* origin/main:
  Polish top bar and animate contextual sidebar toggle (#360)
  fix(profiles): preserve nonlocal agent identity in profile fallback (#327)
  test(agents): pause the status poll around the failed-Stop checks (#431)
  fix(sidebar): paint channel rows with the scroller contents (#428)

Signed-off-by: Sol <49aa1f65411fd096d2e2ec144f1e7aa36fdc76d1b907cfdf7be000c66f9d3b8e@buzz.block.builderlab.xyz>
TheSentinel454 pushed a commit that referenced this pull request Sep 29, 2026
* origin/main: (58 commits)
  flake fix: keep restored reading anchor out of bottom follow (WebKit scroll measurement) (#407)
  Replace fixed browser-test waits with conditions, gates and the clock (#373)
  feat(updates): show installed version in Software Updates settings (#430)
  fix(desktop): allow deep-link delivery to the main webview (#432)
  feat(shell): open your profile from the account menu avatar (#390)
  Polish top bar and animate contextual sidebar toggle (#360)
  fix(profiles): preserve nonlocal agent identity in profile fallback (#327)
  test(agents): pause the status poll around the failed-Stop checks (#431)
  fix(sidebar): paint channel rows with the scroller contents (#428)
  feat(channels): archive and delete channels from settings (#385)
  feat(updates): add in-app auto-updates with restart toast (#312)
  fix(ui): keep background loading from shifting populated views (#418)
  Improve member and agent identity previews (#412)
  Fix initial emoji autocomplete selection (#419)
  Add community membership settings (#348)
  Keep nested replies compact and place actions above message text (#367)
  Import an exact inventory identity from its selected source with retry (#288)
  ci: add gated macOS preview updater feed promotion (#414)
  Set up incomplete inventory identities through a working Use here dialog (#287)
  Show saved local and relay inventory while retaining existing import controls (#286)
  ...
TheSentinel454 pushed a commit that referenced this pull request Sep 29, 2026
* origin/main: (58 commits)
  flake fix: keep restored reading anchor out of bottom follow (WebKit scroll measurement) (#407)
  Replace fixed browser-test waits with conditions, gates and the clock (#373)
  feat(updates): show installed version in Software Updates settings (#430)
  fix(desktop): allow deep-link delivery to the main webview (#432)
  feat(shell): open your profile from the account menu avatar (#390)
  Polish top bar and animate contextual sidebar toggle (#360)
  fix(profiles): preserve nonlocal agent identity in profile fallback (#327)
  test(agents): pause the status poll around the failed-Stop checks (#431)
  fix(sidebar): paint channel rows with the scroller contents (#428)
  feat(channels): archive and delete channels from settings (#385)
  feat(updates): add in-app auto-updates with restart toast (#312)
  fix(ui): keep background loading from shifting populated views (#418)
  Improve member and agent identity previews (#412)
  Fix initial emoji autocomplete selection (#419)
  Add community membership settings (#348)
  Keep nested replies compact and place actions above message text (#367)
  Import an exact inventory identity from its selected source with retry (#288)
  ci: add gated macOS preview updater feed promotion (#414)
  Set up incomplete inventory identities through a working Use here dialog (#287)
  Show saved local and relay inventory while retaining existing import controls (#286)
  ...

Signed-off-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz>
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.

1 participant