Repository navigation
Stop the Slack ingress env-gate test racing the relaunch sweep (CL-7453) - #649
Merged
Merged
Conversation
Proves the leak behind CL-7453's flake directly: after hub.close(), no further relaunch-sweep pass should fire (and log against an already-closed db pool). Also stops slack-tag-mount.test.ts's three env-gate cases from leaving every prior test's hub — and its background loops — running until afterAll, which piled onto the same race.
hub.close() stopped every other background loop (workflow scheduler, credential-expiry sweep, inbox-unsnooze sweep, bench provisioner, sidecar-allocation reconciliation) but never cancelled the relaunch sweep's timer, so it kept firing on its [0, 2s, 5s, 15s, 45s] schedule for the rest of the bun test process — including against a db pool close() had already shut down. A suite that boots several hubs back to back (apps/hub/test/slack-tag-mount.test.ts's env-gate suite) built up these leaked loops, contending with later tests' own boots for Postgres connections and surfacing as `chat·relaunch-sweep: relaunch sweep pass failed: Failed query: select ... from chat.workbench_launch` plus an intermittent test timeout.
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.
Fixes CL-7453