Skip to content

test(java): enable ot.th/ot.rv tracestate sampling scenarios [java@milan.garnier/ot.th] - #7649

Draft
MilanGarnier wants to merge 1 commit into
mainfrom
milan.garnier/enable-otel-th-rv-java-manifest
Draft

test(java): enable ot.th/ot.rv tracestate sampling scenarios [java@milan.garnier/ot.th]#7649
MilanGarnier wants to merge 1 commit into
mainfrom
milan.garnier/enable-otel-th-rv-java-manifest

Conversation

@MilanGarnier

Copy link
Copy Markdown
Contributor

Motivation

Enable the shared OpenTelemetry consistent tracestate sampling coverage for
Java once dd-trace-java#12397 is available.

The implementation is on
milan.garnier/ot.th.

Changes

  • Activate the parametric OTel tracestate sampling suite.
  • Activate all ten end-to-end OTel tracestate sampling classes.
  • Gate the coverage at Java's next development release,
    v1.66.0-SNAPSHOT.

@MilanGarnier MilanGarnier added the ai-generated The pull request includes a significant amount of AI-generated code label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/java.yml                                                      @DataDog/system-tests-reviewers

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Sep 4, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 18 Pipeline jobs failed

Testing the test | System Tests (java, dev) / End-to-end #1 / akka-http 1 — ❌ 12 tests failed · 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

12 failed tests due to assertion errors: incorrect domain usage in agent logs and missing expected tracestate members.

❌ tests.test_otel_tracestate_sampling.Test_EmitOtOnProbabilityDecision_Rate0_5.test_emit_ot_on_probability_decision[akka-http] from system_tests_suite
AssertionError: trace_id=1: no ot= tracestate member emitted on a probability decision
assert 'ot' in Tracestate()

self = <tests.test_otel_tracestate_sampling.Test_EmitOtOnProbabilityDecision_Rate0_5 object at 0x7f45fcf73a40>

    def test_emit_ot_on_probability_decision(self):
        for req, trace_id, expected_rv, expected_th, expected_sampled in self.requests:
            assert req.status_code == 200, f"trace_id={trace_id}: /make_distant_call failed"
    
            tracestate = _outbound_tracestate(req)
...
❌ tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh.test_force_keep_forwards_inherited_rv[akka-http] from system_tests_suite
AssertionError: inherited rv was not forwarded on a force-keep decision
assert None == '1234567890abcd'
 +  where None = <built-in method get of dict object at 0x7f45d42c74c0>('rv')
 +    where <built-in method get of dict object at 0x7f45d42c74c0> = {}.get
 +  and   '1234567890abcd' = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7f45fcf72810>.INHERITED_RV

self = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7f45fcf72810>

    def test_force_keep_forwards_inherited_rv(self):
        """An inherited rv (no th, so no upstream probability decision) is still forwarded on a local force-keep."""
...
❌ tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh.test_force_keep_overrides_inherited_drop_decision[akka-http] from system_tests_suite
AssertionError: inherited rv was not forwarded when overriding an inherited drop
assert None == '65cd67504a538e'
 +  where None = <built-in method get of dict object at 0x7f45d4137680>('rv')
 +    where <built-in method get of dict object at 0x7f45d4137680> = {}.get
 +  and   '65cd67504a538e' = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7f45fcf72300>.DROPPED_RV

self = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7f45fcf72300>

    def test_force_keep_overrides_inherited_drop_decision(self):
        """Upstream already decided to drop (a full th/rv pair); the local force-keep still clears th but forwards the inherited rv unchanged."""
...
↳ and 9 more — View all
Testing the test | System Tests (java, dev) / End-to-end #1 / ratpack 1 — ❌ 12 tests failed · 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

12 failed tests due to assertion errors in test cases related to backend connectivity and trace state validation.

❌ tests.test_otel_tracestate_sampling.Test_EmitOtOnProbabilityDecision_Rate0_5.test_emit_ot_on_probability_decision[ratpack] from system_tests_suite
AssertionError: trace_id=1: no ot= tracestate member emitted on a probability decision
assert 'ot' in Tracestate()

self = <tests.test_otel_tracestate_sampling.Test_EmitOtOnProbabilityDecision_Rate0_5 object at 0x7f43e0223020>

    def test_emit_ot_on_probability_decision(self):
        for req, trace_id, expected_rv, expected_th, expected_sampled in self.requests:
            assert req.status_code == 200, f"trace_id={trace_id}: /make_distant_call failed"
    
            tracestate = _outbound_tracestate(req)
...
❌ tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh.test_force_keep_forwards_inherited_rv[ratpack] from system_tests_suite
AssertionError: inherited rv was not forwarded on a force-keep decision
assert None == '1234567890abcd'
 +  where None = <built-in method get of dict object at 0x7f43b4bc4340>('rv')
 +    where <built-in method get of dict object at 0x7f43b4bc4340> = {}.get
 +  and   '1234567890abcd' = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7f43e0222750>.INHERITED_RV

self = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7f43e0222750>

    def test_force_keep_forwards_inherited_rv(self):
        """An inherited rv (no th, so no upstream probability decision) is still forwarded on a local force-keep."""
...
❌ tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh.test_force_keep_overrides_inherited_drop_decision[ratpack] from system_tests_suite
AssertionError: inherited rv was not forwarded when overriding an inherited drop
assert None == '65cd67504a538e'
 +  where None = <built-in method get of dict object at 0x7f43b4bdf200>('rv')
 +    where <built-in method get of dict object at 0x7f43b4bdf200> = {}.get
 +  and   '65cd67504a538e' = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7f43e0222090>.DROPPED_RV

self = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7f43e0222090>

    def test_force_keep_overrides_inherited_drop_decision(self):
        """Upstream already decided to drop (a full th/rv pair); the local force-keep still clears th but forwards the inherited rv unchanged."""
...
↳ and 9 more — View all
Testing the test | System Tests (java, dev) / End-to-end #1 / resteasy-netty3 1 — ❌ 13 tests failed · 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

13 failed tests in tests/test_smoke.py and tests/test_otel_tracestate_sampling.py due to ValueError: expected domain 'datad0g.com' but got 'tadoghq.com' and JSONDecodeError: Expecting value.

Showing tests most relevant to this failure.

❌ tests.test_otel_tracestate_sampling.Test_EmitOtOnProbabilityDecision_Rate0_5.test_emit_ot_on_probability_decision[resteasy-netty3] from system_tests_suite
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

self = <tests.test_otel_tracestate_sampling.Test_EmitOtOnProbabilityDecision_Rate0_5 object at 0x7fe9c8055df0>

    def test_emit_ot_on_probability_decision(self):
        for req, trace_id, expected_rv, expected_th, expected_sampled in self.requests:
            assert req.status_code == 200, f"trace_id={trace_id}: /make_distant_call failed"
    
>           tracestate = _outbound_tracestate(req)

...
❌ tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh.test_force_keep_forwards_inherited_rv[resteasy-netty3] from system_tests_suite
AssertionError: inherited rv was not forwarded on a force-keep decision
assert None == '1234567890abcd'
 +  where None = <built-in method get of dict object at 0x7fe99ef97940>('rv')
 +    where <built-in method get of dict object at 0x7fe99ef97940> = {}.get
 +  and   '1234567890abcd' = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7fe9c8055a90>.INHERITED_RV

self = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7fe9c8055a90>

    def test_force_keep_forwards_inherited_rv(self):
        """An inherited rv (no th, so no upstream probability decision) is still forwarded on a local force-keep."""
...
❌ tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh.test_force_keep_overrides_inherited_drop_decision[resteasy-netty3] from system_tests_suite
AssertionError: inherited rv was not forwarded when overriding an inherited drop
assert None == '65cd67504a538e'
 +  where None = <built-in method get of dict object at 0x7fe99ef6ba80>('rv')
 +    where <built-in method get of dict object at 0x7fe99ef6ba80> = {}.get
 +  and   '65cd67504a538e' = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7fe9c8055cd0>.DROPPED_RV

self = <tests.test_otel_tracestate_sampling.Test_ForceKeepClearsTh object at 0x7fe9c8055cd0>

    def test_force_keep_overrides_inherited_drop_decision(self):
        """Upstream already decided to drop (a full th/rv pair); the local force-keep still clears th but forwards the inherited rv unchanged."""
...
↳ and 10 more — View all

View all 18 failed jobs.

📋 Copy fix prompt
CI on my pull request is failing. Help me find and fix the root cause of each failing job below — they were flagged as caused by changes in this PR, so focus on the diff. For each job, explain the failure and propose a fix.

Before you start, set up the Datadog software-delivery tooling so you can
query the CI data yourself:

1. Check whether you already have the Datadog software-delivery MCP tools
   (e.g. a `search_datadog_ci_pipeline_events` tool) and the `unblock-pr` skill.
2. If either is missing, STOP and ask me for permission before installing
   anything. Do not install or run anything until I have said yes.
3. Only with my explicit approval, set up the Datadog software-delivery MCP
   server and skills by following:
     https://docs.datadoghq.com/getting_started/software_delivery_mcp_tools/
   then restart so the skill is picked up.
4. If I decline, skip all of the above and work from the context below alone.

Then run /unblock-pr — it will pull the CI data itself. The job context below is what we already know.

If /unblock-pr is not available — because I declined the setup above, or it did not install — work from the context below instead.

Datadog has already classified this failure as caused by changes in this PR.
Take that as given and work the fix:

1. Locate the change. Diff this branch against its base and find the change
   that produces this error. Explain the mechanism, don't just name a file:
     git fetch origin && git diff $(git merge-base origin/main HEAD)...HEAD
2. Reproduce it locally. Run the failing job's command or test before
   proposing anything.
3. Propose the smallest fix that addresses the root cause — not a workaround,
   not a broadened assertion, not a disabled or skipped test.
4. Re-run the same command to confirm, and say exactly what you ran.
5. If the failure turns out to be intermittent rather than deterministic, say
   so plainly instead of "fixing" it — that is a flaky test, and patching it
   hides the problem.

If the right move is to re-run the job rather than change code, use the job
link in the context below. For GitHub Actions: `gh run rerun <run-id> --failed`,
where the run ID is the number after `/runs/` in that URL (not the trailing
number, which is the job ID).

Branch: milan.garnier/enable-otel-th-rv-java-manifest

Testing the test | System Tests (java, dev) / End-to-end #1 / akka-http 1
Commit: cff061a8403f6d39460b42aa12f1e3d80782e9f0
Error (code / test):
12 failed tests due to assertion errors: incorrect domain usage in agent logs and missing expected tracestate members.
CI job: https://github.com/DataDog/system-tests/actions/runs/33860340537/job/100987520039

Testing the test | System Tests (java, dev) / End-to-end #1 / ratpack 1
Commit: cff061a8403f6d39460b42aa12f1e3d80782e9f0
Error (code / test):
12 failed tests due to assertion errors in test cases related to backend connectivity and trace state validation.
CI job: https://github.com/DataDog/system-tests/actions/runs/33860340537/job/100987520233

Testing the test | System Tests (java, dev) / End-to-end #1 / resteasy-netty3 1
Commit: cff061a8403f6d39460b42aa12f1e3d80782e9f0
Error (code / test):
13 failed tests in tests/test_smoke.py and tests/test_otel_tracestate_sampling.py due to ValueError: expected domain 'datad0g.com' but got 'tadoghq.com' and JSONDecodeError: Expecting value.
CI job: https://github.com/DataDog/system-tests/actions/runs/33860340537/job/100987520167

Plus 13 more failing jobs not shown here.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5baea0d | Docs | View more details | Give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated The pull request includes a significant amount of AI-generated code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant