docs(reference): list the CANCELLED that test code calls raise as a test error
Merged
LE
3d ago+2+2+0123456789-1-1-0123456789
This PR takes the follow-up from the review of #2411.
What
- The errors reference now says that
test.step(), arequestcall, or a call on an engine's fixture (such asbrowser.evaluate) can fail withCANCELLEDof classtest, not only theinfrastructureone.
Why
- The only
CANCELLEDrow (Agent codes) gives classinfrastructure, and it names notest.step()case. Atest.step()called from work its phase left running throws aTestError(test-step.ts:24-27), as the #2411 review pointed out. The same holds for a step,requestcall, or fixture call cut while it runs.
How it works
docs/reference/errors.mdx:209adds aCANCELLEDrow to Test code errors: atest.step(),requestcall, or contributed fixture call cut short while it ran (steps.ts:754,steps.ts:942,request.ts:68,fixture-recording.ts:80), and atest.step()called from work its phase left running (test-step.ts:24-27). Classtest, exit 1.docs/reference/errors.mdx:119: the Agent codesCANCELLEDrow gets one sentence pointing to that row. Its class and other text are unchanged.
Issue
Docs-only, so no issue (CONTRIBUTING). The gap was named in the #2411 review.
Verified
Ran it locally: yes - a throwaway runProject probe (not committed) with a 2 s test timeout and a 4 s afterEach, so the engine stays open. Each call is caught and its error logged:
in-flight test.step TestError CANCELLED test test.step cancelled
late test.step TestError CANCELLED test test.step() was called after its test ended
in-flight request.get TestError CANCELLED test GET http://127.0.0.1:<port>/slow cancelled
in-flight browser.evaluate TestError CANCELLED test browser.evaluate cancelled
in-flight locator.tap E2EError CANCELLED infrastructure operation cancelled
late locator.tap E2EError CANCELLED infrastructure operation cancelled
| main | this PR | |
|---|---|---|
CANCELLED of class test in errors.mdx | not listed | Test code errors row |
pnpm checkandpnpm testpass (pnpm testexit 0, e.g. packages/e2e 6722 passed, 15 skipped;docs:check-errors: 98 codes documented; translation drift unchanged at 290). No screenshot: two table cells change, anddocs:checkcompiles the page.- Not changed: the translations, which may lag. #2411 adds the late-call case to the
test.stepThrows table in test.mdx.
Checklist
- Changeset added (
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only. - Breaking change: title carries
!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md). - Docs updated in the same PR: the
docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it. - Contract change: emitted
.d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures. - Engine contract change (
e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.
Summary by CodeRabbit
- Documentation
- Documented
CANCELLEDerrors for runner-cancelled operations, including work stopped by a signal, a closed session, or a body or hook timeout.
- Documented