Skip to content

fix(runner): isolate worker fixture instances across extend() overrides (ENG-1400) - #2554

Merged
kdy1 merged 2 commits into
mainfrom
krzysztof/fix/worker-fixture-extend-overrides
Dec 2, 2026
Merged

kdy1 merged 2 commits into
mainfrom
krzysztof/fix/worker-fixture-extend-overrides

Conversation

@KrzysztofMoch

@KrzysztofMoch KrzysztofMoch commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

What

A worker fixture that depends on another worker fixture now gets a separate instance for each test.extend() chain that overrides one of its dependencies, directly or through another fixture. Chains that share every worker fixture it names still share one instance.

Why

WorkerFixturePool.acquire cached each worker fixture solely by its own identity. When client depended on account and another file defined adminTest = test.extend({ account }), both chains resolved client to the same cached instance. Whichever file ran first set client for the rest of the worker, so the second file got the wrong account's client.

How it works

  1. WorkerFixturePool.instances maps each fixture key (definition.identity ?? definition) to a list of WorkerInstance entries holding { inputs, instance }, where inputs are the instance promises returned by acquire for the chain worker fixtures it depends on (packages/e2e/src/run/fixture-pool.ts:140, packages/e2e/src/run/fixture-pool.ts:199). On lookup, acquire reuses an entry only when all inputs match by reference; on setup failure, only that entry is evicted.
  2. bindFixtures tracks the acquire promise for each worker fixture in workerInstances (packages/e2e/src/run/fixture-pool.ts:321) and passes the resolved dependency promises in declaration order to pool.acquire, leaving built-in fixtures out of the key (packages/e2e/src/run/fixture-pool.ts:354-359). Keying by instance promise rather than by definition handles transitive overrides (client -> link -> account), and keying by promise rather than resolved value handles overrides that pass the extended object through.
  3. Updated the fixture doc comment (packages/e2e/src/collect/registry.ts:66), documented the instance rule under worker fixtures (docs/reference/test.mdx:1185), and added a patch changeset for e2e.
  4. Added unit tests covering both chain orders, transitive overrides with a shared dependency, and pass-through overrides (packages/e2e/tests/unit/fixture-pool.test.ts), plus a runner integration test for the two-file repro in both orders (packages/e2e/tests/integration/worker-fixtures.test.ts).

Issue

ENG-1400

Verified

Ran it locally: yes

  • Built CLI (node node_modules/e2e/dist/cli/bin.js run) on a two-file repro project (workers: 1, retries: 0) where tests/support.ts defines worker fixtures account and client, tests/user.e2e.ts uses test, and tests/admin.e2e.ts overrides account with base.extend:
main this PR
tests/user.e2e.ts fails: ERROR: expected client:user, got client:admin (1 failed | 1 passed (2)) Both files pass (2 passed (2))
=== main ===
   ✓ |web| tests/admin.e2e.ts > admin gets admin client 461ms
 ✓ |web| tests/admin.e2e.ts (1 test) 461ms
   × |web| tests/user.e2e.ts > user gets user client 13ms
     → expected client:user, got client:admin
 ❯ |web| tests/user.e2e.ts (1 test | 1 failed) 13ms

 Test Files  1 failed | 1 passed (2)
      Tests  1 failed | 1 passed (2)

=== this PR ===
   ✓ |web| tests/admin.e2e.ts > admin gets admin client 459ms
 ✓ |web| tests/admin.e2e.ts (1 test) 459ms
   ✓ |web| tests/user.e2e.ts > user gets user client 9ms
 ✓ |web| tests/user.e2e.ts (1 test) 9ms

 Test Files  2 passed (2)
      Tests  2 passed (2)
  • apps/testbed: tests/hooks.e2e.ts passes (7 passed (7) in 2.50s).
  • Skipped pnpm bench:ab: this change adds a reference equality check over a fixture's dependency list on worker-fixture acquisition and does not alter attempt scheduling or execution loops.
  • Not verified locally: mobile (isolation: 'worker'), serial groups, and box (all go through the same bindFixtures -> acquire path).

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Bug Fixes

    • Fixed worker-scoped fixtures so tests that override a dependency receive the correct separate fixture instance, while tests with matching fixture chains can share instances.
    • Improved handling of failed fixture setup so other fixture instances remain available and later requests can retry.
    • Verified that dependent fixtures are set up separately for overridden values, including when overrides are indirect or applied in a different order.
  • Documentation

    • Clarified how worker-fixture instances are shared across tests and how direct and indirect overrides affect dependent fixtures.

@github-actions github-actions Bot added e2e team Opened by the e2e team size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 30, 2026
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Worker fixture overrides

Layer / File(s) Summary
Dependency-aware worker fixture pooling
packages/e2e/src/collect/registry.ts, packages/e2e/src/run/fixture-pool.ts, docs/reference/test.mdx, .changeset/worker-fixture-override-instances.md
The pool stores multiple instances for a fixture identity and reuses an instance only when its ordered dependency-instance promises match. Fixture binding passes those dependency instances to the pool. The documentation and changeset describe the override-related instance behavior.
Override behavior validation
packages/e2e/tests/unit/fixture-pool.test.ts, packages/e2e/tests/integration/worker-fixtures.test.ts
Unit tests cover override chains, shared dependencies, intermediate fixtures, pass-through overrides, and setup failure isolation. Integration tests check customer and admin execution in either order and verify one client setup per account value.

Suggested reviewers: satya164

Change: Bug fix

Merge Risk: Minimal · up to 812a5

This change gives worker fixtures separate instances when a test chain overrides one of their dependencies. It is covered by unit and integration tests, and no merge-blocking risk was found.

Security architecture risk: Minimal · up to 812a5

The change prevents one test chain from receiving a client built for another chain’s account. Chains with the same dependency instances still share fixtures, and each completed instance remains eligible for worker cleanup. No new access path or privilege was identified in the reviewed change.

Security review details

Security Blast Radius

  • inferred — The directly affected scope is fixture consumers sharing a worker-and-target pool. Selecting the right account-backed client removes accidental reuse across override chains; it does not establish a tenant or credential isolation boundary.

Trust Boundaries and Controls

  • observed — Test code still declares fixture dependencies through the existing fixture API. The runner derives the reuse key from planned dependencies and its own acquisition promises; callers do not provide a separate public cache key.

Resilience and Maintainability Implications

  • inferred — An abandoned attempt stops advancing setup without taking ownership of worker fixtures. At shutdown, the pool clears reuse state and returns accepted instances in reverse acceptance order, keeping dependents ahead of their dependencies. Late handoffs are released without registration, and a teardown error does not by itself skip the remaining entries.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6ecf78dc-7bc8-43c7-8461-8d34ed7cd608
Commits

Reviewing files that changed from the base of the PR and between ee3ed9d and 812a557.

Files selected for processing: 2

  • packages/e2e/src/collect/registry.ts
  • packages/e2e/tests/unit/fixture-pool.test.ts
Files skipped from review as they are similar to previous changes: 1

  • packages/e2e/src/collect/registry.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e web: 95 passed

All 95 tests in 43 files
Test Time
🟢 tests/aria-hidden-flow.e2e.ts · 2 passed 768ms
🟢 aria hidden flow › picks the Pro plan by its visible text and confirms it 571ms
🟢 aria hidden flow › another plan shows the error and keeps the picker open 197ms
🟢 tests/async-states.e2e.ts · 2 passed 7.0s
🟢 async states › reads the code off the transient toast and verifies it once the button enables 2.2s
🟢 async states › a wrong code is rejected after the toast has gone 4.8s
🟢 tests/canvas-only.e2e.ts · 2 passed 311ms
🟢 canvas only › taps square, circle, then diamond at their pixel coordinates 159ms
🟢 canvas only › a shape out of order paints the error and resets progress 152ms
🟢 tests/canvas-whiteboard.e2e.ts · 2 passed 483ms
🟢 canvas whiteboard › drags both shapes into their slots and saves 279ms
🟢 canvas whiteboard › bounces a shape off the wrong slot and refuses to save early 204ms
🟢 tests/cart-totals.e2e.ts · 2 passed 471ms
🟢 cart totals › increasing a quantity updates the line total but the order summary stays stale (planted bug) 276ms
🟢 cart totals › a quantity never drops below one 195ms
🟢 tests/checkout-review.e2e.ts · 1 passed 190ms
🟢 shows a raw greeting token and an undefined delivery date (planted bug), yet places the order 190ms
🟢 tests/context-menu-trap.e2e.ts · 2 passed 653ms
🟢 context menu trap › right-click opens nothing; the row menu renames the file 317ms
🟢 context menu trap › the decoy menu items refuse and keep the file 336ms
🟢 tests/control-inventory.e2e.ts · 8 passed 3.7s
🟢 control inventory › check sets the checkbox and the radio without flipping a set one 332ms
🟢 control inventory › check picks a radio the pick replaces with its summary 210ms
🟢 control inventory › a long press and a double click are told apart from a tap 1.0s
🟢 control inventory › the file menu opens on right-click only and Rename renames the file 282ms
🟢 control inventory › setInputFiles attaches files named from the project root 150ms
🟢 control inventory › the details view is left through the browser history 202ms
🟢 control inventory › scrollIntoView brings the footnote into view 161ms
🟢 control inventory › every exercise done shows the success message 1.3s
🟢 tests/css-content-ui.e2e.ts · 2 passed 389ms
🟢 css content ui › the tile labelled Ship it advances and confirming ships 238ms
🟢 css content ui › a wrong tile shows the CSS-rendered error and keeps the picker 151ms
🟢 tests/date-picker.e2e.ts · 2 passed 727ms
🟢 date picker › navigates three months ahead and books the required date 399ms
🟢 date picker › confirming without the exact date shows the error 328ms
🟢 tests/debounced-search.e2e.ts · 2 passed 2.8s
🟢 debounced search › a decoy one character off is refused 1.4s
🟢 debounced search › picking the exact item adds it to the cart 1.4s
🟢 tests/deferred-dialog.e2e.ts · 1 passed 1.0s
🟢 one submit opens one confirm, even when double-clicked 1.0s
🟢 tests/div-soup.e2e.ts · 2 passed 870ms
🟢 div soup › a wrong code is rejected 387ms
🟢 div soup › the right code grants access after the delete tile fixes a typo 483ms
🟢 tests/drag-and-drop.e2e.ts · 2 passed 759ms
🟢 drag and drop › an out-of-order item resets the dropzone 376ms
🟢 drag and drop › dropping Banana then Cherry passes 383ms
🟢 tests/file-round-trip.e2e.ts · 2 passed 443ms
🟢 file round trip › downloads the issued voucher and verifies the same file uploaded back 221ms
🟢 file round trip › rejects a file that is not the voucher, then accepts the issued one 222ms
🟢 tests/filter-deep-link.e2e.ts · 2 passed 291ms
🟢 filter deep link › filtering writes the query to the URL 157ms
🟢 filter deep link › opening a shared link restores the filter 134ms
🟢 tests/gift-card-purchase.e2e.ts · 3 passed 671ms
🟢 gift card purchase › refuses to buy without an amount 173ms
🟢 gift card purchase › refuses a recipient without an at sign 249ms
🟢 gift card purchase › sends the gift card 249ms
🟢 tests/hover-menu.e2e.ts · 2 passed 480ms
🟢 hover menu › a decoy leaf is refused 230ms
🟢 hover menu › hovering Account, then Billing, reaches Redeem voucher 250ms
🟢 tests/iframe-form.e2e.ts · 2 passed 629ms
🟢 iframe form › a wrong code is refused by the host page 292ms
🟢 iframe form › the code read from one frame applies through the other 337ms
🟢 tests/image-only-ui.e2e.ts · 3 passed 568ms
🟢 image only ui › the icons have no names, so the bare svg locator is ambiguous 143ms
🟢 image only ui › a wrong icon shows the error image and keeps the icons 193ms
🟢 image only ui › tapping the star, then the heart, verifies the icons 232ms
🟢 tests/infinite-scroll.e2e.ts · 1 passed 2.9s
🟢 scrolls the feed until the Golden Ticket loads, then claims it 2.9s
🟢 tests/kanban-board.e2e.ts · 3 passed 784ms
🟢 kanban board › pointer drags move both cards into the goal layout 400ms
🟢 kanban board › a swipe along a path drags a card as well 165ms
🟢 kanban board › a plain tap moves nothing and the untouched board is rejected 219ms
🟢 tests/login-form.e2e.ts · 4 passed 849ms
🟢 login form › rejects a malformed email 212ms
🟢 login form › rejects a short password 205ms
🟢 login form › rejects an unknown account 191ms
🟢 login form › signs in and logs out 241ms
🟢 tests/lying-labels.e2e.ts · 4 passed 791ms
🟢 lying labels › the button whose accessible name says Pay now is the wrong one 180ms
🟢 lying labels › a text match for Pay now catches the decoy phrase too 109ms
🟢 lying labels › the field whose accessible name says Amount is the wrong one 238ms
🟢 lying labels › visible text drives the payment through 264ms
🟢 tests/native-dialogs.e2e.ts · 3 passed 565ms
🟢 native dialogs › answers the confirm, prompt, and alert chain 188ms
🟢 native dialogs › dismissing the confirm cancels the order 200ms
🟢 native dialogs › a wrong gift code is rejected 177ms
🟢 tests/new-tab-flow.e2e.ts · 2 passed 483ms
🟢 new tab flow › reads the code in the tab the app opens and enters it back in the original tab 231ms
🟢 new tab flow › a tap that opens a tab leaves the screen on the original tab, and activate shows the new one 252ms
🟢 tests/newsletter-signup.e2e.ts · 1 passed 200ms
🟢 subscribe renders no feedback and logs a TypeError (planted bug) 200ms
🟢 tests/onboarding-wizard.e2e.ts · 5 passed 5.6s
🟢 onboarding wizard › back keeps what was typed and the brief comes back with it 292ms
🟢 onboarding wizard › the address step takes the brief through its bare-div dropdown 329ms
🟢 onboarding wizard › the profile step steers the calendar three decades back 1.3s
🟢 onboarding wizard › the preferences step flips the toggles the brief names and leaves the trap off 1.7s
🟢 onboarding wizard › the review step repeats the brief and finishes with the PIN 2.0s
🟢 tests/order-history.e2e.ts · 2 passed 1.5s
🟢 order history › overview and settings render their panels 239ms
🟢 order history › the orders tab never leaves its loading state (planted bug) 1.2s
🟢 tests/otp-auto-advance.e2e.ts · 3 passed 1.5s
🟢 otp auto-advance › focus advances with each digit and the full code verifies 491ms
🟢 otp auto-advance › backspace on an empty box clears and refocuses the previous one 190ms
🟢 otp auto-advance › a wrong code clears every box and starts over 798ms
🟢 tests/overlay-trap.e2e.ts · 1 passed 652ms
🟢 continues only after the banner and the overlay are gone 652ms
🟢 tests/playbook-cleanup.e2e.ts · 2 passed 616ms
🟢 playbook cleanup › deleting the draft removes it from an exact-name search 302ms
🟢 playbook cleanup › cancelling the dialog keeps the draft searchable 314ms
🟢 tests/price-sorting.e2e.ts · 3 passed 474ms
🟢 price sorting › opens in the featured order with sale prices struck through 128ms
🟢 price sorting › low to high sorts by the original price, not the paid one (planted bug) 160ms
🟢 price sorting › high to low is the same wrong order reversed (planted bug) 186ms
🟢 tests/product-reviews.e2e.ts · 1 passed 141ms
🟢 the running-shoe page lists coffee-grinder reviews (planted bug) 141ms
🟢 tests/promo-storefront.e2e.ts · 1 passed 1.4s
🟢 buys a deal once the promo chrome is out of the way 1.4s
🟢 tests/rich-text-editor.e2e.ts · 2 passed 564ms
🟢 rich text editor › bolding exactly the required word passes the check 265ms
🟢 rich text editor › bold that spills into the previous word fails the check 299ms
🟢 tests/saved-addresses.e2e.ts · 3 passed 639ms
🟢 saved addresses › adds an address and clears the form 211ms
🟢 saved addresses › ignores an add with an empty field 188ms
🟢 saved addresses › delete shows its toast but keeps the address, on retry too (planted bug) 240ms
🟢 tests/shadow-dom-form.e2e.ts · 2 passed 490ms
🟢 shadow DOM form › rejects a wrong access code 248ms
🟢 shadow DOM form › grants access with the code from the hint inside the root 242ms
🟢 tests/smoke.e2e.ts · 1 passed 263ms
🟢 home lists the scenarios and opens one 263ms
🟢 tests/stale-dom.e2e.ts · 1 passed 4.1s
🟢 taps the moving target three times across rebuilds of the list 4.1s
🟢 tests/sticky-chrome.e2e.ts · 1 passed 235ms
🟢 accepts the terms once the button clears the sticky footer 235ms
🟢 tests/virtualized-table.e2e.ts · 1 passed 15.3s
🟢 scrolls the windowed table to the Golden Row and claims it 15.3s
🟢 tests/wishlist.e2e.ts · 2 passed 570ms
🟢 wishlist › saving toggles the button and the tab badge 245ms
🟢 wishlist › the wishlist tab renders the empty state despite the badge count (planted bug) 325ms

Tested by e2e 0.25.0 · 1m 4s · web · run artifacts

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview

Built from 812a557: https://e2e-inc-docs-pr-2554.vercel.app/docs

Changed pages:

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e web agent: 34 passed

36 agent steps · 26 replayed from cache · 26 model calls · 134.3k tokens (94% cached) · $0.0056

All 34 tests in 5 files
Test Agent Time
🟢 tests-agent/control-inventory.e2e.ts · 7 passed 7 steps 7.9s
🟢 control inventory › check sets the checkbox and the radio 1 step 832ms
🟢 control inventory › check picks a radio the pick replaces with its summary 1 step 300ms
🟢 control inventory › a long press and a double click are chosen over a plain tap 1 step 947ms
🟢 control inventory › a right-click opens the file menu and Rename renames the file 1 step 2.6s
🟢 control inventory › upload attaches the named project files 1 step 2.6s
🟢 control inventory › back returns from the details view to the inventory 1 step 280ms
🟢 control inventory › scroll_to brings the footnote into view 1 step 395ms
🟢 tests-agent/login-form.e2e.ts · 1 passed 1 step 444ms
🟢 act signs in with the benchmark account 1 step 444ms
🟢 tests-agent/planted-bugs.e2e.ts · 3 passed 5 steps · 9 calls 13.2s
🟢 cart totals: a judgment catches the stale order summary 2 steps · 4 calls 5.6s
🟢 checkout review: a judgment catches the broken copy 1 step · 1 call 1.3s
🟢 wishlist: a judgment catches the lost saved items 2 steps · 4 calls 6.3s
🟢 tests-agent/scenarios.e2e.ts · 22 passed 22 steps · 17 calls 1m 17s
🟢 act completes shadow-dom-form 1 step · 3 calls 3.9s
🟢 act completes lying-labels 1 step · 3 calls 4.4s
🟢 act completes iframe-form 1 step · 3 calls 3.7s
🟢 act completes infinite-scroll 1 step 3.4s
🟢 act completes virtualized-table 1 step 21.9s
🟢 act completes overlay-trap 1 step 958ms
🟢 act completes sticky-chrome 1 step 891ms
🟢 act completes async-states 1 step · 3 calls 6.2s
🟢 act completes debounced-search 1 step 2.3s
🟢 act completes hover-menu 1 step 531ms
🟢 act completes drag-and-drop 1 step 481ms
🟢 act completes kanban-board 1 step 650ms
🟢 act completes context-menu-trap 1 step 2.6s
🟢 act completes stale-dom 1 step 471ms
🟢 act completes otp-auto-advance 1 step 727ms
🟢 act completes date-picker 1 step 838ms
🟢 act completes rich-text-editor 1 step 10.1s
🟢 act completes playbook-cleanup 1 step 610ms
🟢 act completes promo-storefront 1 step 1.3s
🟢 act completes new-tab-flow 1 step · 5 calls 8.9s
🟢 act completes gift-card-purchase 1 step 2.4s
🟢 act filters the list and the URL carries the filter 1 step 210ms
🟢 tests-agent/unique-cache.e2e.ts · 1 passed 1 step 312ms
🟢 act adds an address with a run-unique label 1 step 312ms

Tested by e2e 0.25.0 · 1m 40s · web · run artifacts

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

No issues found across 6 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@blacksmith-sh

blacksmith-sh Bot commented Nov 30, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
tests/integration/test-step.test.ts/test.step around a test timeout >
cuts the call running in a step as the timeout cuts any call, not as one the test did
not await
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e android agent: 20 passed

24 agent steps · 15 replayed from cache · 50 model calls · 379.5k tokens (84% cached) · $0.0237

All 20 tests in 1 file
Test Agent Time
🟢 tests-agent/scenarios.e2e.ts · 20 passed 24 steps · 50 calls 7m 1s
🟢 act completes Login Form 1 step 34.0s
🟢 act completes Infinite Scroll List 1 step 34.7s
🟢 act completes Modal Flow 1 step 14.3s
🟢 act completes Bottom Tabs 1 step 10.0s
🟢 act completes Text Input Variations 1 step 9.8s
🟢 act completes Broken Accessibility 2 steps · 5 calls 16.8s
🟢 act completes Vision Only 2 steps · 1 call 6.8s
🟢 act completes Gestures 1 step · 9 calls 22.2s
🟢 act completes Async States 1 step · 23 calls 55.5s
🟢 act completes Debounced Search 1 step 8.3s
🟢 act completes Huge Virtualized List 1 step 1m 55s
🟢 act completes Flattened Registration Form 2 steps · 1 call 8.6s
🟢 act completes Flattened Login 2 steps · 6 calls 14.4s
🟢 act completes Sticky Chrome Target 1 step 9.0s
🟢 act completes WebView Accessibility 1 step · 5 calls 15.0s
🟢 act completes Permission Prompt 1 step 7.3s
🟢 act completes Product Catalog 1 step 9.0s
🟢 act completes Error Recovery 1 step 10.5s
🟢 act completes Choice Controls 1 step 9.8s
🟢 act completes Sequential Onboarding 1 step 10.6s

Tested by e2e 0.25.0 · 7m 3s · android-emulator · run artifacts

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e ios: 67 passed, 1 skipped

All 68 tests in 8 files
Test Time
⏭️ tests/controls.e2e.ts · 25 passed, 1 skipped 3m 0s
🟢 control inventory › a label query resolves a labeled text field 11.5s
🟢 control inventory › a labeled field answers name, display value, value reads, fill, and clear 13.8s
🟢 control inventory › a placeholder query and attribute reads find the field 5.8s
🟢 control inventory › getAttribute reads the label, resource id, and class an Appium suite asks for 5.1s
🟢 control inventory › a secure field takes a fill and denies value reads 7.1s
🟢 control inventory › press sends a character and Enter through the soft keyboard 8.3s
🟢 control inventory › a field autofocuses on mount and focus() moves the focus 9.7s
🟢 control inventory › toBeFocused follows the focus 7.6s
🟢 control inventory › a switch checks, unchecks, and reports its state 8.7s
🟢 control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap 8.6s
🟢 control inventory › checkbox and radio roles check, uncheck, and report their state 9.6s
🟢 control inventory › a radio group reports the checked option 7.8s
🟢 control inventory › buttons report disabled, enabled, and a state that arrives later 7.7s
🟢 control inventory › a display: none element is absent rather than hidden, its visible twin attached 6.0s
🟢 control inventory › a header answers its accessible name 4.3s
🟢 control inventory › a tab row answers count, all, texts, filters, positions, and switching 6.1s
🟢 control inventory › a list answers counts, list-form text, reads, and boxes in order 7.0s
⏭️ control inventory › a row contains its texts (skipped: React Native flattens a plain View out of the accessibility tree on both platforms: XCTest and the Android helper report a View with a testID as a leaf beside its children, so filter({ has }) and a query scoped to it match nothing; only Sc…)
🟢 control inventory › a long press lands as one 8.5s
🟢 control inventory › tap({ count: 3 }) lands three presses 8.0s
🟢 control inventory › pointer verbs land at the point asked for 9.1s
🟢 control inventory › an ambiguous locator fails at once 5.5s
🟢 control inventory › screenshot, restart, and clearState reopen the app on its home list 12.1s
🟢 refusals › verbs a device never declares are refused before the engine 2ms
🟢 refusals › keys the soft keyboard cannot send are refused by the engine 409ms
🟢 refusals › a missing locator fails as not found once its timeout passes 1.1s
🟢 tests/device-fixture.e2e.ts · 15 passed 2m 3s
🟢 device fixture › setAppearance flips the color scheme the app reads 12.8s
🟢 device fixture › setOrientation rotates the window and viewport dimensions 7.0s
🟢 device fixture › the clipboard reads back what was written 5.3s
🟢 device fixture › home leaves the app, openApp brings it back where it was 7.6s
🟢 device fixture › closeApp then openApp relaunches on the home list 8.8s
🟢 device fixture › closeApp leaves the next commands on the same device 11.8s
🟢 device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN 5.7s
🟢 device fixture › openLink opens the scenario a deep link names 13.1s
🟢 device fixture › isAppInstalled finds the app under test and no app that is absent 6.1s
🟢 device fixture › uninstallApp removes the app until installApp puts it back 10.2s
🟢 device fixture › device.back pops the scenario 5.5s
🟢 device fixture › unstable_raw reaches the test session through the raw driver 4.3s
🟢 device fixture › setLocation and clearLocation change what the app reads 10.6s
🟢 device fixture › enrollBiometrics and setBiometrics answer a biometric prompt 9.8s
🟢 device fixture › pressButton is refused on an iOS simulator 4.1s
🟢 tests/device.e2e.ts · 7 passed 1m 19s
🟢 permissions all grants the microphone without a system dialog 11.6s
🟢 sequential onboarding echoes the exact values 24.4s
🟢 isKeyboardShown follows the keyboard up and through a dismissal 7.5s
🟢 a control under the keyboard reads hidden and refuses a tap until the keyboard is dismissed 10.3s
🟢 a shake is sent without an error and leaves the screen readable 5.0s
🟢 onboarding rejects a malformed email before advancing 9.4s
🟢 dismissing the keyboard over choice controls leaves them as they were 10.5s
🟢 tests/flows-lists.e2e.ts · 7 passed 4m 1s
🟢 infinite scroll reaches the target item 34.4s
🟢 product catalog adds exactly two of the right variant 10.4s
🟢 gestures: long-press, then swipe left 9.1s
🟢 sticky chrome: accept below the fold, then continue 12.8s
🟢 async states: load, pull to refresh, claim through the toast 11.5s
🟢 huge virtualized list reaches row 512 2m 30s
🟢 web view coupon form applies the code shown on the page 12.2s
🟢 tests/flows.e2e.ts · 7 passed 1m 8s
🟢 text inputs unlock the submit button 11.9s
🟢 filled text inputs report their values 10.3s
🟢 modal flow confirms through the native alert 9.7s
🟢 bottom tabs act inside the last tab 7.7s
🟢 error recovery retries, then confirms the delete 9.3s
🟢 choice controls place the exact order 7.4s
🟢 debounced search selects the target once results arrive 11.7s
🟢 tests/login-form.e2e.ts · 3 passed 43.2s
🟢 login form › rejects a malformed email 12.4s
🟢 login form › rejects an unknown account 12.5s
🟢 login form › signs in and logs out 18.3s
🟢 tests/scroll-to.e2e.ts · 2 passed 2m 47s
🟢 screen.scrollTo reaches the last row of the list and comes back to the first 1m 43s
🟢 locator.scrollTo scrolls the list it names 1m 4s
🟢 tests/smoke.e2e.ts · 1 passed 7.7s
🟢 home lists the scenarios and opens one 7.7s

Tested by e2e 0.25.0 · 8m 1s · ios-simulator · run artifacts

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e ios agent: 21 passed, 1 skipped

25 agent steps · 12 replayed from cache · 54 model calls · 376.4k tokens (80% cached) · $0.0271

All 22 tests in 1 file
Test Agent Time
⏭️ tests-agent/scenarios.e2e.ts · 21 passed, 1 skipped 25 steps · 54 calls 8m 17s
🟢 act completes Login Form 1 step 40.9s
🟢 act completes Infinite Scroll List 1 step 38.4s
🟢 act completes Modal Flow 1 step 11.6s
🟢 act completes Bottom Tabs 1 step 8.1s
🟢 act completes Text Input Variations 1 step 13.1s
🟢 act completes Broken Accessibility 2 steps · 9 calls 43.1s
🟢 act completes Vision Only 2 steps · 6 calls 26.0s
🟢 act completes Gestures 1 step · 5 calls 18.9s
🟢 act completes Async States 1 step · 8 calls 20.3s
🟢 act completes Debounced Search 1 step · 1 call 28.5s
🟢 act completes Flattened Registration Form 2 steps · 1 call 25.2s
🟢 act completes Flattened Login 2 steps · 10 calls 47.1s
🟢 act completes Sticky Chrome Target 1 step 12.9s
🟢 act completes WebView Accessibility 1 step 12.0s
🟢 act completes Permission Prompt 1 step 10.8s
🟢 act completes Photo Picker 1 step · 2 calls 26.4s
🟢 act completes Product Catalog 1 step 10.1s
🟢 act completes Error Recovery 1 step 10.7s
🟢 act completes Choice Controls 1 step · 5 calls 33.2s
🟢 act completes Stripe PaymentSheet 1 step · 7 calls 44.0s
🟢 act completes Apple Pay 1 step 15.2s
⏭️ act completes Apple Pay Billing Address (skipped: the CI simulator's Apple Pay sheet skips the billing-address step, so the scenario cannot be completed there)

Tested by e2e 0.25.0 · 8m 18s · ios-simulator · run artifacts

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

Automated review (AI triage pass), not yet read by a maintainer.

Reviewed ee3ed9d00. Root-cause fix: the worker pool now keys a worker fixture by its identity plus the pool instances of the worker fixtures it names, so test.extend({ account }) gets its own client while chains that share every dependency still share one instance.

Verified:

  • Bug is real on main: with fixture-pool.ts reverted to main (rebuilt), the new integration test fails (customer client expected passed, got failed) and all 3 new unit tests fail. With the PR, 40/40 unit and 7/7 integration pass.
  • Keying by the acquire promise (not definition, not value) is what makes the transitive (client -> link -> account) and pass-through override cases work, and both have a unit test that fails without it.
  • Module re-evaluation still reuses instances: the dependency's promise comes back from the same identity entry, so the dependent's inputs match again.
  • Built-ins stay out of the key (fixture-pool.ts:352-356), which is correct because the pool is per worker and target.

Should fix

  1. fixture-pool.ts:213-218 - nothing tests the per-entry eviction. I replaced it with this.instances.delete(key) (which drops the other chain's healthy instance) and all 40 unit tests still pass. Add a test where the admin chain's client setup fails once, then check that the customer chain still gets its existing instance and the admin chain retries.
  2. registry.ts:95 - the identity doc still says "a worker keeps one instance per identity". This PR makes that wrong. The type doc at line 66 was updated, but this one was not.

For the maintainer

  • This is a semantic change for worker fixtures: one worker can now hold several live instances of the same fixture (one per distinct set of dependency instances), and each lives until the worker ends. That matches the documented intent. Expensive worker fixtures used under many overriding chains will now set up once per chain.

@KrzysztofMoch

Copy link
Copy Markdown
Member Author

[gemini-4-neon] responding on behalf of KrzysztofMoch

Addressed both items from the automated review in 812a557:

  1. Added a unit test in packages/e2e/tests/unit/fixture-pool.test.ts where the overriding chain's client setup fails once, verifying the customer chain keeps its existing instance and the overriding chain retries.
  2. Updated the identity doc comment at packages/e2e/src/collect/registry.ts:95 to match the dependency-aware keying.

@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 2 files (changes from recent commits).

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e android: 68 passed, 1 skipped

All 69 tests in 8 files
Test Time
⏭️ tests/controls.e2e.ts · 26 passed, 1 skipped 3m 33s
🟢 control inventory › a label query resolves a labeled text field 30.5s
🟢 control inventory › a labeled field answers name, display value, value reads, fill, and clear 22.1s
🟢 control inventory › a placeholder query and attribute reads find the field 12.5s
🟢 control inventory › getAttribute reads the label, resource id, and class an Appium suite asks for 9.7s
🟢 control inventory › a secure field takes a fill and denies value reads 8.8s
🟢 control inventory › press sends a character and Enter through the soft keyboard 9.6s
🟢 control inventory › a field autofocuses on mount and focus() moves the focus 10.0s
🟢 control inventory › toBeFocused follows the focus 8.4s
🟢 control inventory › a switch checks, unchecks, and reports its state 8.9s
🟢 control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap 6.9s
🟢 control inventory › checkbox and radio roles check, uncheck, and report their state 8.1s
🟢 control inventory › a tab role answers getByRole 3.9s
🟢 control inventory › a radio group reports the checked option 6.9s
🟢 control inventory › buttons report disabled, enabled, and a state that arrives later 7.4s
🟢 control inventory › a display: none element is absent rather than hidden, its visible twin attached 5.7s
🟢 control inventory › a header answers its accessible name 3.7s
🟢 control inventory › a tab row answers count, all, texts, filters, positions, and switching 5.4s
🟢 control inventory › a list answers counts, list-form text, reads, and boxes in order 6.3s
⏭️ control inventory › a row contains its texts (skipped: React Native flattens a plain View out of the accessibility tree on both platforms: XCTest and the Android helper report a View with a testID as a leaf beside its children, so filter({ has }) and a query scoped to it match nothing; only Sc…)
🟢 control inventory › a long press lands as one 7.5s
🟢 control inventory › a double tap lands inside the 300 ms window 6.6s
🟢 control inventory › tap({ count: 3 }) lands three presses 6.9s
🟢 control inventory › an ambiguous locator fails at once 5.4s
🟢 control inventory › screenshot, restart, and clearState reopen the app on its home list 9.8s
🟢 refusals › verbs a device never declares are refused before the engine 7ms
🟢 refusals › keys the soft keyboard cannot send are refused by the engine 968ms
🟢 refusals › a missing locator fails as not found once its timeout passes 1.1s
🟢 tests/device-fixture.e2e.ts · 14 passed 1m 41s
🟢 device fixture › setOrientation rotates the window and viewport dimensions 5.9s
🟢 device fixture › home leaves the app, openApp brings it back where it was 5.5s
🟢 device fixture › foregroundApp sees the home screen after home() 4.6s
🟢 device fixture › closeApp then openApp relaunches on the home list 9.0s
🟢 device fixture › closeApp leaves the next commands on the same device 8.3s
🟢 device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN 4.5s
🟢 device fixture › openLink opens the scenario a deep link names 4.9s
🟢 device fixture › isAppInstalled finds the app under test and no app that is absent 3.5s
🟢 device fixture › uninstallApp removes the app until installApp puts it back 9.4s
🟢 device fixture › device.back pops the scenario 5.1s
🟢 device fixture › unstable_raw reaches the test session through the raw driver 4.5s
🟢 device fixture › setNetwork and setAirplaneMode change what the app sees 10.9s
🟢 device fixture › setLocation and clearLocation change what the app reads 19.6s
🟢 device fixture › pressButton shows the volume panel on Android 5.6s
🟢 tests/device.e2e.ts · 8 passed 1m 2s
🟢 permission prompt › allowing the system dialog enables the microphone 6.7s
🟢 permission prompt › a denied prompt recovers once the permission is granted outside 12.7s
🟢 permissions all grants the microphone without a system dialog 7.1s
🟢 sequential onboarding echoes the exact values 10.4s
🟢 a shake is sent without an error and leaves the screen readable 5.5s
🟢 a lock and an unlock both complete and leave the app readable 6.9s
🟢 onboarding rejects a malformed email before advancing 5.9s
🟢 dismissing the keyboard over choice controls leaves them as they were 6.6s
🟢 tests/flows-lists.e2e.ts · 7 passed 3m 9s
🟢 infinite scroll reaches the target item 29.2s
🟢 product catalog adds exactly two of the right variant 9.6s
🟢 gestures: long-press, then swipe left 8.2s
🟢 gestures: double-tap completes the flow 9.4s
🟢 sticky chrome: accept below the fold, then continue 10.8s
🟢 async states: load, pull to refresh, claim through the toast 12.1s
🟢 huge virtualized list reaches row 512 1m 50s
🟢 tests/flows.e2e.ts · 7 passed 48.8s
🟢 text inputs unlock the submit button 5.6s
🟢 filled text inputs report their values 5.3s
🟢 modal flow confirms through the native alert 8.7s
🟢 bottom tabs act inside the last tab 6.4s
🟢 error recovery retries, then confirms the delete 8.6s
🟢 choice controls place the exact order 5.9s
🟢 debounced search selects the target once results arrive 8.3s
🟢 tests/login-form.e2e.ts · 3 passed 26.2s
🟢 login form › rejects a malformed email 7.1s
🟢 login form › rejects an unknown account 7.0s
🟢 login form › signs in and logs out 12.1s
🟢 tests/scroll-to.e2e.ts · 2 passed 1m 6s
🟢 screen.scrollTo reaches the last row of the list and comes back to the first 40.5s
🟢 locator.scrollTo scrolls the list it names 25.7s
🟢 tests/smoke.e2e.ts · 1 passed 5.5s
🟢 home lists the scenarios and opens one 5.5s

Tested by e2e 0.25.0 · 11m 54s · android-emulator · run artifacts

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 30, 2026

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

Automated review (AI triage pass), not yet read by a maintainer.

Reviewed 812a557a0. Re-review. Both items from my review of ee3ed9d00 are fixed, and nothing else changed.

Earlier review:

  1. Eviction test: fixed. fixture-pool.test.ts:672 fails the admin chain's client setup once, then checks that the customer chain keeps its instance and the admin chain retries. Mutation-checked: replacing the per-entry eviction at fixture-pool.ts:213 with this.instances.delete(key) fails only this test. On the PR, 41/41 pass.
  2. identity doc: fixed at registry.ts:95.

CI is green.

For the maintainer

  • Same semantic note as before: one worker can now hold several live instances of a worker fixture, one per distinct set of dependency instances, and each lasts until the worker ends.
  • Interplay with #2400 (worker fixtures by import URL): the code doesn't overlap. #2400 changes how identity is computed, and this PR keys on identity plus dependency instances, so the two compose. Merging both conflicts in docs/reference/test.mdx (both edit the worker-fixture bullet list near line 1176). worker-fixtures.test.ts merges cleanly. Whichever lands second rebases and keeps both bullets.

@michal-e2e michal-e2e left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.

Reviewed at 812a557a0. The runtime fix holds: the instance key change is right and fixes the shared-client bug from the description, with one docs gap left before merge.

Must fix

  • Please update the docs and skill that still say a worker fixture is set up once per worker and target: docs/fixtures.mdx:181, docs/reference/test.mdx:1148, skills/e2e/references/writing-tests.md:354 (plus its synced copy under plugins/e2e), and packages/core/src/types.ts:1208 (the scope: 'worker' doc comment). Describe it instead as one instance per worker, target and set of instances of the worker fixtures it names, each live until the worker ends. The new bullet in the reference page already says this, so these lines now contradict it. Behavior changes need the matching docs and skill updated in the same PR.

Optional

const known = this.instances.get(key);
if (known !== undefined) return known;
const known = this.instances.get(key) ?? [];
const same = known.find((entry) => entry.inputs.length === inputs.length && entry.inputs.every((input, index) => input === inputs[index]));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add a test for overriding a non-first input, such as client naming { region, account } with account overridden? Every new test overrides the first fixture, so they still pass if this match compares only the first input. Can we also add a test for a worker fixture naming a built-in, run first in a plain chain and then in a chain that overrides that built-in with a worker fixture? That catches an entry with fewer inputs matching (<= instead of === on the length). The code is right on both today, so these are only guards.

@michal-e2e michal-e2e removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Dec 1, 2026

@kdy1 kdy1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note

This text was drafted with AI and posted after human approval.

  • Harness: T3 Code
  • AI agents: coordinator: Claude Opus 5.5 (claude-opus-5-5), reviewer: gpt-6.2-astra, reviewer: gpt-6.2-sol, reviewer: Claude Opus 5.5 (claude-opus-5-5), reviewer: Claude Sonnet 5.5 (claude-sonnet-5-5)

Verdict: Approve

This review approves the pull request. The P3 items are optional and do not block the merge.

Reviewed commit: 812a557a0b9d4d748db538da2457d40dca4c87ee

  • P3 (non-blocking): 1 (1 inline)

Comment thread docs/reference/test.mdx
declares gets a new instance each time the file is imported again, and
the old one stays set up until the worker ends: declare it in a module
the file imports.
- A worker fixture that names another worker fixture gets a separate instance

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P3 · Non-blocking · Docs and the skill still say a worker fixture is set up once per worker and target

Optional. This does not block the merge.

This new bullet says that a worker fixture can have more than one instance in a worker. These lines still say that it has one instance, or is set up once, per worker and target:

  • docs/reference/test.mdx:1148, at the start of the same section, so the page now contradicts itself
  • docs/fixtures.mdx:181
  • skills/e2e/references/writing-tests.md:354, and its synced copy under plugins/e2e
  • packages/core/src/types.ts:1208, the scope: 'worker' JSDoc in the public types

Trigger: a user reads the fixtures guide, or an agent reads the skill through e2e guide writing-tests, and expects client to be set up once. At this head, test and adminTest = test.extend({ account }) set up client twice in one worker. The new integration test logs setup:client:admin and setup:client:customer in the same worker.

AGENTS.md ("Contracts") requires a behavior change to update the matching docs/**/*.mdx page and skills/e2e/ in the same change.

@kdy1
kdy1 added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 616153e Dec 2, 2026
56 checks passed
@kdy1
kdy1 deleted the krzysztof/fix/worker-fixture-extend-overrides branch December 2, 2026 01:33
@github-actions github-actions Bot mentioned this pull request Dec 2, 2026
michal-e2e added a commit that referenced this pull request Dec 2, 2026
Conflict in docs/reference/test.mdx, "Worker fixtures": this branch replaced
the bullet on reuse and Bun with four bullets, and #2554 added a bullet
after it for fixtures that name an overridden fixture. Kept this branch's
four bullets and the bullet of #2554, each word for word. The bullet of
#2554 comes second, before the bullets on import URLs.
michal-e2e added a commit that referenced this pull request Dec 2, 2026
…(ENG-1553)

With #2554 on main a worker fixture is keyed by the instances of the worker
fixtures it names. So when another resolve hook makes the runner set a
fixture up again, each worker fixture that names it is set up again too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e team Opened by the e2e team size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants