Skip to content

Commit be5ecaf

Browse files
[test optimization] Lighter init in worker thread (#5293)
1 parent 77abd1e commit be5ecaf

File tree

2 files changed

+7
-3
lines changed
  • ci
  • packages/dd-trace/src/ci-visibility/dynamic-instrumentation

2 files changed

+7
-3
lines changed

ci/init.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22
const tracer = require('../packages/dd-trace')
3-
const { isTrue } = require('../packages/dd-trace/src/util')
3+
const { isTrue, isFalse } = require('../packages/dd-trace/src/util')
44
const log = require('../packages/dd-trace/src/log')
55

66
const isJestWorker = !!process.env.JEST_WORKER_ID
@@ -23,7 +23,7 @@ const options = {
2323
flushInterval: isJestWorker ? 0 : 5000
2424
}
2525

26-
let shouldInit = true
26+
let shouldInit = !isFalse(process.env.DD_CIVISIBILITY_ENABLED)
2727

2828
if (isPackageManager()) {
2929
log.debug('dd-trace is not initialized in a package manager.')

packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ class TestVisDynamicInstrumentation {
6969
// To avoid infinite initialization loops, we're disabling DI and tracing in the worker.
7070
env: {
7171
...process.env,
72+
DD_CIVISIBILITY_ENABLED: 0,
7273
DD_TRACE_ENABLED: 0,
73-
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 0
74+
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 0,
75+
DD_CIVISIBILITY_MANUAL_API_ENABLED: 0,
76+
DD_TRACING_ENABLED: 0,
77+
DD_TRACE_TELEMETRY_ENABLED: 0
7478
},
7579
workerData: {
7680
config: config.serialize(),

0 commit comments

Comments
 (0)