Skip to content

Fix two CI e2e flakes: stylesheet-count race and dev-db queue wedge - #1656

Merged
RhysSullivan merged 2 commits into
mainfrom
e2e-flake-fixes
Aug 18, 2026
Merged

Fix two CI e2e flakes: stylesheet-count race and dev-db queue wedge#1656
RhysSullivan merged 2 commits into
mainfrom
e2e-flake-fixes

Conversation

@RhysSullivan

@RhysSullivan RhysSullivan commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Three independent flakes, all seen on PR #1648's CI run and both reproducible on main.

Artifacts stylesheet-count race (E2E cloud shard 2)

artifacts.test.ts asserted document.styleSheets.length is unchanged after opening an artifact. The count moves on its own in dev: TanStack Start swaps its route-styles <link> as route matches settle, and the swapped-in link only counts once loaded, so the assertion raced it (expected 3 to be 4).

The shell's tokens now deliberately mirror the console's, so no token name or value can identify its stylesheet either. The shell's compiled stylesheet now declares a provenance marker (--mcp-apps-shell-stylesheet: 1 on :root), and the test asserts the computed marker is present inside the shell document and absent from the console document — deterministic in both directions.

dev-db socket wedge (E2E cloud shard 5 cascade)

The cloud signIn: callback set no session (500) cascade: PGLiteSocketServer's query queue returned out of its drain loop when a query rejected at the JS level, leaving its processing flag latched true. After one such throw nothing was ever dequeued again — in-flight requests hung, new connections' startup packets sat unanswered (CONNECT_TIMEOUT), and the stack was bricked for the rest of the run. The patch now rejects the one entry, drops pipeline affinity, and keeps draining.

Also in the patch:

  • The idleTimeout backstop only reaps connections actually holding queue affinity (open pipeline or transaction). It used to kill any 30s-idle connection — the resting state of every healthy postgres.js pool held by a long-lived scope — which raced live queries into sporadic write CONNECTION_ENDED 500s.
  • detach() rejections from error/close handlers no longer become unhandled rejections.

Regression tests in dev-db-socket-concurrency.node.test.ts cover the wedge (fails with CONNECT_TIMEOUT on the unpatched code), idle-at-rest survival, and the backstop still reaping a client stalled mid-pipeline.

Verified: lint, typecheck, mcp-apps-shell package tests (82), and vitest run --project cloud scenarios/artifacts.test.ts (4 scenarios) all pass locally.

tool-invoker discovery-shape timeout (Test job)

describes built-in discovery tool shapes that accept their runtime output runs three sandboxed describe.tool round-trips plus three type-checks of the described contracts under vitest's 5s default and timed out at 5.6s on a loaded runner. Raised to the { timeout: 10000 } ceiling the file's other sandbox-heavy tests already use.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1656

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1656

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1656

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1656

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1656

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1656

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1656

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1656

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1656

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1656

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1656

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1656

executor

npm i https://pkg.pr.new/executor@1656

commit: 4992122

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 4992122 Commit Preview URL

Branch Preview URL
Aug 18 2026, 04:24 PM

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 18, 2026 16:29
@RhysSullivan
RhysSullivan merged commit 1c24f56 into main Aug 18, 2026
43 checks passed
@RhysSullivan
RhysSullivan deleted the e2e-flake-fixes branch August 18, 2026 17:22
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