Skip to content

Commit

Permalink
[test optimization] Lighter init in worker thread (#5293)
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez authored Feb 19, 2025
1 parent 77abd1e commit be5ecaf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ci/init.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
const tracer = require('../packages/dd-trace')
const { isTrue } = require('../packages/dd-trace/src/util')
const { isTrue, isFalse } = require('../packages/dd-trace/src/util')
const log = require('../packages/dd-trace/src/log')

const isJestWorker = !!process.env.JEST_WORKER_ID
Expand All @@ -23,7 +23,7 @@ const options = {
flushInterval: isJestWorker ? 0 : 5000
}

let shouldInit = true
let shouldInit = !isFalse(process.env.DD_CIVISIBILITY_ENABLED)

if (isPackageManager()) {
log.debug('dd-trace is not initialized in a package manager.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ class TestVisDynamicInstrumentation {
// To avoid infinite initialization loops, we're disabling DI and tracing in the worker.
env: {
...process.env,
DD_CIVISIBILITY_ENABLED: 0,
DD_TRACE_ENABLED: 0,
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 0
DD_TEST_FAILED_TEST_REPLAY_ENABLED: 0,
DD_CIVISIBILITY_MANUAL_API_ENABLED: 0,
DD_TRACING_ENABLED: 0,
DD_TRACE_TELEMETRY_ENABLED: 0
},
workerData: {
config: config.serialize(),
Expand Down

0 comments on commit be5ecaf

Please sign in to comment.