Skip to content

test: wait for serve shutdown before fixture cleanup - #280

Merged
jkyberneees merged 1 commit into
mainfrom
codex/fix-serve-test-teardown
Sep 28, 2026
Merged

jkyberneees merged 1 commit into
mainfrom
codex/fix-serve-test-teardown

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

The main-branch cancellation test sometimes removed its temporary session directory while the serve goroutine was still persisting the interrupted turn. Closing the listener started shutdown but did not wait for it, producing TempDir RemoveAll: directory not empty in the failing main run.

Use a shared test-server lifecycle helper that closes pooled HTTP connections and the listener, then waits for serveOnListener to return before environment and directory cleanup. Apply it to the other unjoined serve fixtures and remove the filesystem quiet-period workaround. Reset the cancellation fixtures' WebSocket rate limiter so repeated runs remain isolated. Production code is unchanged.

Validation:

  • Both cancellation tests passed 20 repetitions each under the race detector, with no late persistence errors.
  • go test -race -short -count=1 -timeout 300s ./cmd/odek
  • golangci-lint run ./cmd/odek: 0 issues.
  • govulncheck ./...: no vulnerabilities found.

@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
odek c8b4af8 Commit Preview URL

Branch Preview URL
Sep 28 2026, 07:49 PM

@jkyberneees
jkyberneees merged commit d273fb7 into main Sep 28, 2026
10 checks passed
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