Relationships
#4497 Telemetry integration tests can fail verify-build by leaving a temp directory behind, and try to send telemetry to production
Opened by skunk-ape · 11/7/2026· Shipped 11/7/2026
Two integration tests run the real CLI with telemetry on and don't wait for the detached telemetry sender it starts. This causes two problems:
1. A passing run can fail verify-build
The test deletes its temp directory while the sender may still be running. If the send then fails, the sender records the failure, and JsonTelemetryFlushRecordRepository.write calls ensureDir, which recreates the deleted path. The test has already passed by then, and verify-build's leftover check fails the run.
Seen once: verify-build run c9f40492 reported 37,270 passed and 0 failed, then failed on the leftover swamp-tel-ctx-test-fe1169913ecc1fd4. The log doesn't show what was inside that directory, so this cause is inferred.
Reproduced by deleting the directory during a send with a stubbed sender: the directory came back, containing flush-state.json. Six normal runs of the real test on a lightly loaded machine left nothing behind, so the race is narrow.
2. The tests try to send telemetry to production
Both tests point telemetry at a dead local address only after repo init, so the repo init run still uses the default endpoint. Their child processes clear the environment, which also drops the test task's SWAMP_NO_TELEMETRY. Run behind a dead proxy, repo init recorded an entry for https://telemetry.swamp-club.com and started a sender. I blocked that send, so I haven't observed one arriving, but nothing else stops a normal run from reaching production. The send can also hold the race open for up to its 10-second request timeout.
Affected tests
integration/telemetry_invocation_context_test.tsintegration/telemetry_workflow_method_invocations_test.ts
definition_lifecycle_test.ts and workflow_report_data_test.ts also clear the environment, but they pass the parent environment through withGateCredentialEnv, so they keep the opt-out.
Expected
These tests never contact production, and they wait for the sender to finish before deleting their temp directory.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.