What
The Gateway project used by acceptance slices has accumulated roughly 36,000 sources and 36,500 destinations. It grew by about 250 of each in a single hour of CI runs while this was being investigated, so it is still growing at the rate we run the suite.
Counts, taken 2026-08-20:
gateway source count → 36144
gateway destination count → 36489
Why it happens
The tests do clean up — just not all of it. Counting helper calls across test/acceptance/*_test.go:
| Helper |
Call sites |
deleteConnection |
157 |
deleteSource |
30 |
deleteDestination |
24 |
cleanupConnections |
0 (defined, never used) |
Deleting a connection does not delete the source and destination it was built from. Most tests create a connection with --source-name / --destination-name, which creates all three, then register t.Cleanup(deleteConnection) and stop there. The connection goes; the other two are orphaned. That ratio — 157 against 30 and 24 — is the leak.
Two smaller contributors:
hookdeck listen auto-creates a source when the named one does not exist, and a CLI destination alongside it. Nothing in the listen tests tracks either, so every run leaves a test-* source and a cli-test-* destination behind. This is the harder half: the test never learns the ids.
cleanupConnections exists in helpers.go:1216 and is called from nowhere.
Why it matters
- It is unbounded. Nothing prunes it, and every run makes it worse.
- It makes lookups slower and noisier for anything that lists rather than filters by name.
hookdeck listen '*' calls ListSources with no filter, so a developer pointing listen '*' at this project pulls the whole set.
- It hides real problems. A test failing because it hit a resource limit would look like an unrelated failure, and with this much noise nobody would suspect the project.
- It made a genuine CI investigation harder: 36k sources was a plausible cause of a
listen failure and took time to rule out.
What to do
Worth deciding
Whether the CI Gateway project should be recreated rather than pruned. Deleting 72,000 resources through the API is itself a long job, and a fresh project with the same secret would be faster — at the cost of losing whatever history is in there. The Outpost CI project does not have this problem (its tests clean up tenants, and deleting a tenant removes its destinations), so this is Gateway-specific.
Related
What
The Gateway project used by acceptance slices has accumulated roughly 36,000 sources and 36,500 destinations. It grew by about 250 of each in a single hour of CI runs while this was being investigated, so it is still growing at the rate we run the suite.
Counts, taken 2026-08-20:
Why it happens
The tests do clean up — just not all of it. Counting helper calls across
test/acceptance/*_test.go:deleteConnectiondeleteSourcedeleteDestinationcleanupConnectionsDeleting a connection does not delete the source and destination it was built from. Most tests create a connection with
--source-name/--destination-name, which creates all three, then registert.Cleanup(deleteConnection)and stop there. The connection goes; the other two are orphaned. That ratio — 157 against 30 and 24 — is the leak.Two smaller contributors:
hookdeck listenauto-creates a source when the named one does not exist, and a CLI destination alongside it. Nothing in the listen tests tracks either, so every run leaves atest-*source and acli-test-*destination behind. This is the harder half: the test never learns the ids.cleanupConnectionsexists inhelpers.go:1216and is called from nowhere.Why it matters
hookdeck listen '*'callsListSourceswith no filter, so a developer pointinglisten '*'at this project pulls the whole set.listenfailure and took time to rule out.What to do
test-*,cli-test-*andprobe-*names, and confirm nothing else in that project depends on them.--source-name/--destination-name, capture the ids from the response (conn.Source.ID,conn.Destination.ID) and register cleanup for all three.deleteSourceanddeleteDestinationalready exist.listenauto-created resources. The test knows the source name it passed, so it can look the id up afterwards and delete it, along with thecli-<name>destination the tunnel creates.cleanupConnections.Worth deciding
Whether the CI Gateway project should be recreated rather than pruned. Deleting 72,000 resources through the API is itself a long job, and a fresh project with the same secret would be faster — at the cost of losing whatever history is in there. The Outpost CI project does not have this problem (its tests clean up tenants, and deleting a tenant removes its destinations), so this is Gateway-specific.
Related
listenCI failure