mirror of
https://github.com/cline/cline.git
synced 2026-08-29 03:52:41 +08:00
b532b174ba
* fix(e2e): stop VS Code e2e worker teardown from timing out
The ext-vscode-test-e2e job has been failing on main with 'Worker teardown
timeout of 60000ms exceeded' even though every test passes. Playwright only
reports an Electron app as closed once the process exits AND every holder of
its stdio pipes is gone (ChildProcess 'close' waits on the extra fd3/fd4
pipes Playwright creates for Electron). Any VS Code descendant that outlives
the main process (chrome_crashpad_handler, GLib's 'dconf watch' helper,
xdg-open browser handlers, VS Code 1.135's agent host CLI subprocess that
logs 'unable to kill the process') keeps those pipes open, so app.close()
never resolves and the worker teardown hangs on it until its 60s timeout
fails the job.
Harness fixes, each removing one source of that wedge:
- closeAppForTeardown now SIGKILLs the whole process group (taskkill /T on
Windows) when app.close() times out, instead of only the main pid — and
does so even when the main process already exited, which is exactly the
wedged state. Playwright launches Electron detached, so pid == pgid.
- Launch VS Code with --disable-crash-reporter so no crashpad handler
outlives the app holding the harness pipes.
- Seed the fresh user-data-dir with chat.disableAIFeatures: true so VS
Code's own AI features (rolled out via server-side experiments, so CI
breaks without any repo change) never start their agent host process.
- Drop the page.close() teardown: closing VS Code's last window quits the
whole app, and ElectronApplication.close() on an already-exited app
deadlocks; the app fixture's app.close() closes windows itself while the
app is alive.
- Codex sign-in no longer opens a real external browser under E2E_TEST; the
codex-oauth test drives the OAuth callback itself, and the browser was an
orphaned process holding the harness pipes on the runner.
* fix(core): deflake hub daemon e2e tests on Windows runners
sdk-test on windows-latest fails intermittently in the hub daemon e2e
files:
- shutdown.e2e.test.ts dies with a bare 'Error: socket hang up'. That
message is the ws handshake (http.ClientRequest) failing, not the
/shutdown fetch (an undici failure prints 'TypeError: fetch failed'):
a freshly spawned bun daemon on a loaded 2-core Windows runner
occasionally drops its first accepted connection before writing the
upgrade response. Real hub clients reconnect with backoff, and the test
asserts shutdown behavior rather than first-connection reliability, so
openAuthenticatedSocket now retries transient handshake failures within
a 15s budget.
- singleton.e2e.test.ts times out waiting for daemon discovery: it still
used the 10s hang guard that 0cfc90158 already raised to 30s in
shutdown.e2e.test.ts for the same reason. Use the same 30s guard.
- Raise the e2e testTimeout to 60s so a test that legitimately spawns two
daemons back to back can survive slow-runner startups instead of the
discovery hang guard being cut off by the test timeout.