Skip to content

Avoid fixed timeouts around queued page evaluations #68

Description

@mohidmakhdoomi

Summary

A custom Playwright hit-test wraps locator.evaluate(...) in a fixed five-second expect.poll. Under software-rendering contention, one page evaluation can remain queued longer than the outer poll timeout even though it eventually returns the expected result. The test then reports that the control cannot receive pointer events when the trace proves that it can.

This is a standalone test-observability defect. It should be addressed independently of browser pooling, worker reduction, renderer replacement, retries, or wider arbitrary timeouts.

Reproduced trace sequence

During E2E_WORKERS=22 npm run test:smoke in Chromium with SwiftShader:

  • expect.poll for “rotation control center should receive pointer events” started at 13.007 s;
  • its locator.evaluate(...) started at 13.026 s;
  • the outer five-second poll expired at 18.008 s;
  • the still-running evaluation completed at 18.166 s;
  • the evaluation result was true.

The assertion failed roughly 158 ms before its first successful observation returned. The screenshot and elementsFromPoint inspection also showed the rotation button above the canvas and receiving the center hit.

Root cause

The outer deadline can expire while a single in-flight predicate evaluation is still waiting on the saturated browser main thread. A wall-clock polling window shorter than one possible predicate execution is not a valid interactability check.

The subsequent click({force: true}) also bypasses Playwright actionability even though the intended contract is that a user can perform a normal click.

Proposed direction

Use Playwright's native actionability path for the actual interaction:

await expect(rotationButton).toBeVisible();
await rotationButton.click();
await expect(resumeButton).toBeVisible();

If a separate diagnostic is still useful, record it without making a shorter outer timer authoritative over an in-flight evaluation. Do not solve this by forcing the click or merely increasing another fixed timeout.

Acceptance criteria

  • Control interactions use a normal Playwright click rather than force: true.
  • No fixed outer poll can expire while its first page evaluation is still in flight.
  • Tests still prove the control is visible, actionable, and changes application state.
  • The relevant Chromium interaction tests pass repeatedly with SwiftShader at the configured high-worker stress level.
  • Serial-local and CI behavior remain covered without retries masking actionability failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions