Skip to content

Commit 7415ce7

Browse files
committed
test(ci-visibility): fix flaky agent-proxy tests
Add nock.cleanAll() to beforeEach hook to prevent HTTP mock state leakage between tests. Without proper cleanup, nock interceptors from previous tests could interfere with subsequent tests, causing random failures in CI. This follows the pattern already used in other test files like exporter.spec.js and request.spec.js. Fixes 4 flaky tests related to _isGzipCompatible and evpProxyPrefix assertions.
1 parent d119cf2 commit 7415ce7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/dd-trace/test/ci-visibility/exporters/agent-proxy/agent-proxy.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const { clearCache } = require('../../../../src/agent/info')
1919
describe('AgentProxyCiVisibilityExporter', () => {
2020
beforeEach(() => {
2121
clearCache()
22+
nock.cleanAll()
2223
})
2324

2425
const flushInterval = 50

0 commit comments

Comments
 (0)