test: run Go runtime shutdowns in-process again #156

Merged
codinget merged 2 commits from test/restore-inprocess-shutdowns into main 2026-07-31 22:35:04 +02:00
Owner

Stacked on #155 (based on fix/tsconnect-late-wasm-resume). Refs #147, #152.

Removes the three workarounds the late-_resume bug forced, now that it is fixed at the source:

  • packages/tsconnect/src/shutdown.probe.ts — deleted; the shutdown test runs in-process again, on its own initIPN runtime (and starts a second one afterwards, as before)
  • packages/tsconnect/src/ipn.test.ts — the shared integration suite shuts its runtime down in after() again
  • packages/tsconnect-workerconnect.shutdown.probe.ts deleted and connect.test.ts restored to the in-process form (revert of ad0d525), with its stale "uncaughtException noise" comment replaced by the real reason the suite shares one runtime (wasm compile cost)
  • both packages' *.probe.ts tsconfig excludes are gone, so probe-shaped helpers would be typechecked again

The restored in-process shutdowns are the regression test for #147: with the workarounds removed but the fix absent, this suite produces 63 late "Go program has already exited" errors and a failing test.

Verification

  • @webnet/tsconnect 78 passed / 1 skipped, @webnet/tsconnect-worker 71 passed
  • tsconnect-worker test:coverage (no --test-force-exit) still exits on its own
  • soak of both suites, sequential and parallel: no late _resume errors

Unrelated note: tsconnect-worker's transfers.test.ts holds the process ~60 s after its tests finish on a TTL timer; that predates this branch (it reproduces on main) and only shows up in the non-force-exit coverage run.

🤖 Generated with Claude Code

Stacked on #155 (based on `fix/tsconnect-late-wasm-resume`). Refs #147, #152. Removes the three workarounds the late-`_resume` bug forced, now that it is fixed at the source: - `packages/tsconnect/src/shutdown.probe.ts` — deleted; the shutdown test runs in-process again, on its own `initIPN` runtime (and starts a second one afterwards, as before) - `packages/tsconnect/src/ipn.test.ts` — the shared integration suite shuts its runtime down in `after()` again - `packages/tsconnect-worker` — `connect.shutdown.probe.ts` deleted and `connect.test.ts` restored to the in-process form (revert of ad0d525), with its stale "uncaughtException noise" comment replaced by the real reason the suite shares one runtime (wasm compile cost) - both packages' `*.probe.ts` tsconfig excludes are gone, so probe-shaped helpers would be typechecked again The restored in-process shutdowns are the regression test for #147: with the workarounds removed but the fix absent, this suite produces 63 late `"Go program has already exited"` errors and a failing test. ## Verification - `@webnet/tsconnect` 78 passed / 1 skipped, `@webnet/tsconnect-worker` 71 passed - `tsconnect-worker` `test:coverage` (no `--test-force-exit`) still exits on its own - soak of both suites, sequential and parallel: no late `_resume` errors Unrelated note: `tsconnect-worker`'s `transfers.test.ts` holds the process ~60 s after its tests finish on a TTL timer; that predates this branch (it reproduces on `main`) and only shows up in the non-force-exit coverage run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
codinget added the
Agent
claude-opus-5
Agentic
labels 2026-07-31 02:06:04 +02:00
Author
Owner

Autonomous review finding: AI_CHANGES.md now contains two entries with the identical '@webnet/tsconnect — no late Go program has already exited after shutdown()' heading. The second is an older, incomplete version that omits the dead-handle behavior added by 342b996, so the append-only disclosure log is both duplicated and internally inconsistent. Please remove the stale duplicate added by 279733f and keep the new workaround-removal entry plus #155's complete existing entry. The restored tests and tsconfig changes otherwise look good; targeted typechecks pass and all CI checks are green. (Gitea does not allow this authenticated account to formally request changes on its own PR.)

Autonomous review finding: AI_CHANGES.md now contains two entries with the identical '@webnet/tsconnect — no late Go program has already exited after shutdown()' heading. The second is an older, incomplete version that omits the dead-handle behavior added by 342b996, so the append-only disclosure log is both duplicated and internally inconsistent. Please remove the stale duplicate added by 279733f and keep the new workaround-removal entry plus #155's complete existing entry. The restored tests and tsconfig changes otherwise look good; targeted typechecks pass and all CI checks are green. (Gitea does not allow this authenticated account to formally request changes on its own PR.)
Author
Owner

Fixed in 962ed20: removed the stale duplicate. It came from the union merge driver on AI_CHANGES.md during the rebase onto #155 - both the pre- and post-342b996 versions of the entry were kept. The remaining #147 entry is the complete one (dead-handle behaviour included), alongside this branch's workaround-removal entry.

Fixed in 962ed20: removed the stale duplicate. It came from the union merge driver on `AI_CHANGES.md` during the rebase onto #155 - both the pre- and post-342b996 versions of the entry were kept. The remaining #147 entry is the complete one (dead-handle behaviour included), alongside this branch's workaround-removal entry.
codinget marked the pull request as ready for review 2026-07-31 22:08:20 +02:00
codinget changed target branch from fix/tsconnect-late-wasm-resume to main 2026-07-31 22:30:26 +02:00
codinget added 2 commits 2026-07-31 22:30:26 +02:00
test: run Go runtime shutdowns in-process again
CI / lint (pull_request) Successful in 3m58s
CI / format (pull_request) Successful in 2m55s
CI / install (pull_request) Successful in 13m11s
CI / typecheck (pull_request) Successful in 3m35s
CI / typetest (pull_request) Successful in 1m30s
CI / node-tests (pull_request) Successful in 1m34s
CI / browser-tests (pull_request) Successful in 3m59s
279733fc01
The child-process probes, the missing shutdown() in the tsconnect
integration teardown, and the *.probe.ts tsconfig excludes all existed
only to keep the late "Go program has already exited" errors away from
node:test. That bug is fixed, so drop the workarounds; the restored
in-process shutdowns are the regression test for it.

Refs #147, #152

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
docs: drop the duplicated #147 disclosure entry
CI / format (pull_request) Successful in 2m43s
CI / lint (pull_request) Successful in 2m47s
CI / install (pull_request) Successful in 9m49s
CI / typecheck (pull_request) Successful in 2m46s
CI / typetest (pull_request) Successful in 2m43s
CI / node-tests (pull_request) Successful in 2m21s
CI / browser-tests (pull_request) Successful in 4m23s
962ed20219
The union merge driver kept both the pre- and post-rebase versions of the
tsconnect shutdown entry; the older one predates the dead-handle change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
codinget merged commit 962ed20219 into main 2026-07-31 22:35:03 +02:00
codinget deleted branch test/restore-inprocess-shutdowns 2026-07-31 22:35:04 +02:00
Sign in to join this conversation.