Skip to content

test(web): accept remaining timeout budget in diagnostics - #1690

Merged
okwasniewski merged 3 commits into
e2e-inc:mainfrom
shamilovtim:codex/web-timeout-budget-assertion
Nov 11, 2026
Merged

okwasniewski merged 3 commits into
e2e-inc:mainfrom
shamilovtim:codex/web-timeout-budget-assertion

Conversation

@shamilovtim

@shamilovtim shamilovtim commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
  • Accept a remaining Playwright timeout above 1500 ms and at most 2000 ms instead of requiring exactly 2000 ms. Deadline setup can legitimately leave 1999 ms; the lower bound still catches a tap that gives up early.
  • Check the error prefix before parsing, while retaining the missing-locator diagnostic, NOT_ACTIONABLE / nonretryable result and 3500 ms elapsed-time bound. Only the existing test changes.

Issue

Fixes #1689.

Verified

Ran it locally: yes

The original main assertion failed on a valid 1999 ms diagnostic in CI. The revised assertion passed the complete web package suite in real Chromium:

Test Files  75 passed (75)
     Tests  784 passed | 1 skipped (785)

For a negative control, changed only the locator evaluateHandle timeout to Math.max(1, Math.floor(remaining() / 2)):

Assertion Same half-budget mutation
Previous PR assertion 83 passed
Revised assertion 82 passed; 1 failed: expected 1000 to be greater than 1500

Restored production code and rebuilt; the revised case passed. pnpm check also passed.

@github-actions github-actions Bot added the size:XS Up to 9 changed lines, not counting tests, fixtures, or the lockfile label Nov 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

View guided diff | Re-trigger cubic

@shamilovtim

Copy link
Copy Markdown
Contributor Author

[Codex] responding on behalf of shamilovtim

Head 70d7f9b702d2ebb6b27436d02046b82c049ec716 has passed all required CI checks. The review finding is fixed and resolved; the latest automated review reports no new issues. The repository status command reports READY with no blockers.

GitHub denied adding Ready for Human Review because this account lacks label permissions. A maintainer can apply that label; no further code change is pending.

@okwasniewski okwasniewski 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.

[claude-opus-5-5] automated review on behalf of @okwasniewski

The diagnosis is right. clickControl starts its Deadline before the first evaluateHandle, so 1999 ms is a valid value and the exact 2000ms match was the bug. Fixing the test is the right fix.

One change is needed before merge:

  • toBeGreaterThan(0) can never fail, because remaining() is clamped to at least 1 (actions.ts:172). As written, the test accepts any timeout up to 2000. To check, I changed actions.ts:185 to { timeout: Math.max(1, remaining() / 2) }, so the tap gives up at half its budget. This branch stays green (the whole file passes 83/83), while main's assertion fails. The test is named "within one deadline", so it should pin the full budget. The drift before the first read is a few ms, so a floor like toBeGreaterThan(1500) stays stable and still catches this.

Nit: if the regex stops matching, Number(undefined) fails with "expected NaN to be greater than 0", which hides the real message. Keep the prefix check first:

expect(error?.message).toMatch(/^tap did not become actionable in time: .*Timeout \d+ms exceeded/);
const timeoutMs = Number(/Timeout (\d+)ms exceeded/.exec(error?.message ?? '')?.[1]);
expect(timeoutMs).toBeGreaterThan(1500);
expect(timeoutMs).toBeLessThanOrEqual(2000);

Require a remaining timeout above 1500 ms and no greater than 2000 ms, and check the diagnostic prefix before parsing. This preserves tolerance for deadline drift while catching a tap that receives only half its budget.
@shamilovtim

shamilovtim commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

[Codex] responding on behalf of shamilovtim

Fixed both points from the review in 82076ff. The remaining timeout must now be above 1500 ms and no greater than 2000 ms, and the anchored prefix assertion runs before parsing. The NOT_ACTIONABLE, nonretryable, missing-locator and 3500 ms elapsed-time checks remain.

Verified the same integer half-budget mutation against both assertions: the old file passed 83/83; the revised file passed 82 and failed only this case with expected 1000 to be greater than 1500. The prefix assertion passed. Restoring production timeout handling made the revised case pass. The complete Chromium web suite passed 784 tests with one existing skip, and pnpm check passed. No production code changes are included.

All current-head CI gates passed. The earlier formal change request remains pending maintainer re-review.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

View guided diff | Re-trigger cubic

@okwasniewski okwasniewski 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.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked at 82076ff. Both asks are done:

  • The floor is now > 1500. I re-ran the half-budget mutant (actions.ts:185 -> remaining() / 2), and it now fails with expected 1000 to be greater than 1500. On the PR head, check-actions.test.ts passes 83/83.
  • The prefix assertion runs before parsing.

CI is green. Approving and queueing.

@okwasniewski
okwasniewski added this pull request to the merge queue Nov 11, 2026
Merged via the queue into e2e-inc:main with commit 7ebf082 Nov 11, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for Human Review size:XS Up to 9 changed lines, not counting tests, fixtures, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web timeout test flakes when the remaining budget is below 2000 ms

2 participants