Repository navigation
test(integration): cover cold-start module tracing - #843
Draft
joeyzhao2018 wants to merge 1 commit into
Draft
joeyzhao2018 wants to merge 1 commit into
joeyzhao2018 wants to merge 1 commit into
Conversation
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 6 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 0f389cb | Docs | View more details | Give us feedback! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add seven local RIE integration cases for the existing cold-start tracing feature, covering npm redirect and layer handler entrypoints:
A shared handler loads real CommonJS modules under
/var/task,/opt, and/var/runtimeduring initialization, then lazily loads another module on invocation two. Each case invokes the same environment nine times.The raw-log checker verifies span cardinality across all exports, trace/parent relationships, path classification, initialization timing, warm-load parenting, and absence of stale replay. Module-load markers prove that suppression cases really execute the fixture modules. The managed fixture explicitly uses one worker so warm-cache assertions are meaningful.
Motivation
Existing cases disable cold-start tracing, so they do not protect this behavior during the Node.js migration. The new positive cases already exposed an existing dd-trace module-load bookkeeping bug.
These cases use structural assertions rather than new log goldens: real load durations change which non-fixture modules exceed the tracing threshold. Known fixture modules use a 50ms blocking wait against a 10ms threshold, avoiding machine-speed-dependent expectations about the entire tree.
Existing return-value snapshots and runtime-tag checks still apply. Existing log goldens, normalization, production code, and dependency pins are unchanged.
Testing Guidelines
node --test integration_tests_local/check-*.test.js: 41 passing, including 32 new checker tests. Negative tests cover missing capture, duplicates, incorrect parenting/classification, orphaned/cyclic trees, filtering violations, and stale replay.bash -n integration_tests_local/run.sh: pass.npm run lintandgit diff --check: pass.ritm.jsmounted read-only: all seven cases pass, nine invocations each. This is isolated-fix validation, not a passing result for the unmodified release or the full migration candidate.The workflow runs the checker tests and new cases in the existing Node18/20/22/24/26 × amd64/arm64 matrix. Local validation above is arm64 only; this is emulator coverage, not deployed AWS certification.
Additional Notes
Draft / release dependency: DataDog/dd-trace-js#10535
The positive cases fail with the current v6 tracer pin: a caught module-loading error leaves the cold-start capture stack unfinished, so application module spans are missing. CI intentionally uses the normal released dependencies—no overlay, skipped assertions, or expected-failure exemption has been added. The current v6 integration jobs are therefore expected to remain red until the upstream fix is released and pinned here.
Before marking this ready:
No golden capture or recapture is needed. Structural failures save raw logs under
/tmp/l2-raw-*.log.Types of Changes
Check all that apply