Software versions
- OS: MacOS 14.6.1
- Pact library: @pact-foundation/pact@15.0.1
- Node Version: Node 22.11.0
Issue Checklist
Please confirm the following:
Expected behaviour
When running the tests, no error should be shown.
Actual behaviour
When running the tests using Jest / Pact-js, the following error is reported before (or after?) every test:
Failed to initialise global tracing subscriber - a global default trace dispatcher has already been set
The reference implementation has several places where this could come from:
https://github.com/search?q=repo%3Apact-foundation%2Fpact-reference%20set_global_default&type=code
This seems to be linked to the --watch or --watchAll flag as when I run without them, no error is reported.
Note that this does not seem to influence the execution of the tests (they run just as well).
Am I right to assume that this global default trace dispatcher is linked to the telemetry that pact collects and that setting the PACT_DO_NOT_TRACK =true env var should disable it? I tried it without success.
Steps to reproduce
I have gathered a minimal reproductible repo here:
https://github.com/bertrandE/jest-global-tracing-repro/tree/main
Just run npm run test.
The logs of the execution:
PASS src/b.pact.jest.ts
Suite B
✓ Test B (349 ms)
Failed to initialise global tracing subscriber - a global default trace dispatcher has already been set
PASS src/a.pact.jest.ts
Suite A
✓ Test A (6 ms)
Test Suites: 2 passed, 2 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 1.336 s
Relevant log files
debug.txt
Software versions
Issue Checklist
Please confirm the following:
Expected behaviour
When running the tests, no error should be shown.
Actual behaviour
When running the tests using Jest / Pact-js, the following error is reported before (or after?) every test:
The reference implementation has several places where this could come from:
https://github.com/search?q=repo%3Apact-foundation%2Fpact-reference%20set_global_default&type=code
This seems to be linked to the
--watchor--watchAllflag as when I run without them, no error is reported.Note that this does not seem to influence the execution of the tests (they run just as well).
Am I right to assume that this
global default trace dispatcheris linked to the telemetry that pact collects and that setting thePACT_DO_NOT_TRACK =trueenv var should disable it? I tried it without success.Steps to reproduce
I have gathered a minimal reproductible repo here:
https://github.com/bertrandE/jest-global-tracing-repro/tree/main
Just run
npm run test.The logs of the execution:
Relevant log files
debug.txt