test(examples/chat): reap e2e server process groups + pre-free ports#678
Merged
Conversation
The Playwright global-setup spawns `nx serve` (:4200) and `langgraph dev` (:2024); both fork child processes that hold the actual sockets. Teardown only `SIGTERM`-ed the parents, so the real port-holders survived — and a run killed mid-flight skipped teardown entirely. The next run's `waitForPort` then bound to the STALE server and silently tested the OLD bundle. - global-setup: free :4200/:2024 before starting (recover from a prior orphan) and spawn both servers `detached: true` so they lead their own process groups. - global-teardown: kill the process GROUPS (SIGTERM then SIGKILL backstop), then free the ports as a final backstop. - process-utils: freePort (best-effort lsof) + killTree helpers. Verified: full chat e2e suite runs clean and both ports are FREE afterward (previously orphaned). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
examples/chatPlaywrightglobal-setupspawnsnx serve(:4200) andlanggraph dev(:2024). Both fork child processes that hold the actual sockets, butglobal-teardownonlySIGTERM-ed the parents — so the real port-holders survived. A run killed mid-flight skipped teardown entirely. Either way, the next run'swaitForPortbound to the stale server and silently tested the old bundle.This bit me directly while fixing #677: a fix looked like it had no effect for ~4 e2e iterations, because the served bundle was stale.
Fix
freePort(:4200/:2024)before starting (recover from a prior orphan); spawn both serversdetached: trueso they lead their own process groups.freePort(best-effortlsof, no-ops if absent) +killTreehelpers.Verification
Full chat e2e suite runs clean, and both ports are FREE afterward — previously they were orphaned. (Pre-rebase the suite showed the one expected
error-handlingfailure from the GM-2 base lacking #677; rebased onto current main it's 41/41.)🤖 Generated with Claude Code