Skip to content

Conversation

@watson
Copy link
Contributor

@watson watson commented Oct 24, 2025

Motivation

The Node.js tracer would fail if the test probe didn't look like a real probe.

Changes

Ensure that the probe sent to the tracer contains a capture object, when captureSnapshot is set to true. This was introduced recently: #5576

This makes the test probe look more like a real probe, since a tracer might expect this object to be present (the Node.js tracer expects this).

If we want to have a system test to validate that tracers can handle the situation where this object isn't present, that should be a dedicated test for that scenario.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

@watson watson requested review from a team as code owners October 24, 2025 09:28
Copy link
Contributor Author

watson commented Oct 24, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

CODEOWNERS have been resolved as:

tests/debugger/test_debugger_probe_snapshot.py                          @DataDog/debugger @DataDog/system-tests-core
tests/debugger/utils/probes/probe_snapshot_log_line.json                @DataDog/debugger @DataDog/system-tests-core
tests/debugger/utils/probes/probe_snapshot_log_mixed.json               @DataDog/debugger @DataDog/system-tests-core

Ensure that the probe sent to the tracer contains a `capture` object,
when `captureSnapshot` is set to `true`.

This makes the test probe look more like a real probe, since a tracer
might expect this object to be present (the Node.js tracer expects this).
@watson watson force-pushed the watson/DEBUG-4611/fix-tests branch from 71487b8 to 433de6d Compare October 24, 2025 09:30
"id": "",
"version": 0,
"captureSnapshot": true,
"capture": {
Copy link
Member

@jpbempel jpbempel Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capture object is optional and should not be a requirement for a probe definition

Copy link
Contributor Author

@watson watson Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I wrote in the PR description, that test case should preferably be a separate system test. It hasn't been something that has been an issue since we launched the Node.js tracer, so I would say it's only optional in theory.

But I agree it would be good to support that, just not for this test, whose purpose is different.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capture object has well defined default values from the beginning, so to me it does not make sense to put this artifical capture object here

Copy link
Contributor Author

@watson watson Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context, captureSnapshot: true was added to this test this week. This broke CI for the Node.js tracer, because the PR that landed it skipped the Node.js tests before landing. Then shortly after, the @bug line was added for Node.js to make Node.js CI green again. However, I think it's better, for now, to actually run the test for Node.js instead of just labeling it as a bug (which in the real world, it's not)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

captureSnapshot is required because it makes the difference between a regular log probe and a snapshot probe

Copy link
Contributor Author

@watson watson Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

captureSnapshot is required because it makes the difference between a regular log probe and a snapshot probe

Yeah, I know that. I'm not saying adding it was a mistake. Just that it unfortunately broke Node.js CI because the issue wasn't detected before after the PR was merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add a test for this scenario, the CI will be also broken for you. How it is different than adding this @bug ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the @bug doesn't run this test and hence hides any issues related to what this test is testing. Also, it's incorrect calling it a bug as our backend is always adding the capture object to the probe payload sent via RC. I agree that we should probably support the case where it's not there if we ever decide to remove it in some scenarios, but since we haven't done that yet, it's not a bug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add a test for this scenario, we can add a @bug or @missing_feature for Node.js to that specifically, while still allowing other tests to run that tests other things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default the UI happens to send :

  "capture": {
    "maxReferenceDepth": 3
  },

but at first (as the option was not exposed) it was sending nothing.
Also the IDE plugin can also choose to send nothing.
You are not guarantee to always have this cpature object.

@watson watson requested a review from tylfin October 24, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants