Skip to content

Context tests improvement proposals#11839

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
bbujon/context-continuation-tests-slim
Jul 2, 2026
Merged

Context tests improvement proposals#11839
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
bbujon/context-continuation-tests-slim

Conversation

@PerfectSlayer

Copy link
Copy Markdown
Contributor

What Does This Do

This PR is a proposal of few refactoring changes:

  • Dedicated context listener assert methods:
    • The goal is to have a (small) dedicated API to evaluate context events, and without having to give back the previously asserted event.
    • It allows to tests more nicely and finely the events as we can now easily test for the next event right after a context method call.
    • I did not change the test logic by introducing finer event tests, I only deduplicated events that are previous tests from the past list element check.
    • This should also help when we will refine product / feature integration with the new context API to write more granular tests.
  • Add null annotations for context manager implementation
    • Minor change adding @NonNull annotation on ContextManager implementation in core
  • Fix variable name following 11763
    • Minor nitpick about variable name following type change

Motivation

Those are proposals. Let me know which one you agree with and want to get merged, and which one should I drop from this branch.

Additional Notes

This is a trimmed down version of #11837

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@PerfectSlayer PerfectSlayer requested a review from a team as a code owner July 2, 2026 11:44
@PerfectSlayer PerfectSlayer added the tag: no release notes Changes to exclude from release notes label Jul 2, 2026
@PerfectSlayer PerfectSlayer requested review from a team as code owners July 2, 2026 11:44
@PerfectSlayer PerfectSlayer requested review from amarziali and mcculls and removed request for a team July 2, 2026 11:44

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

This PR refactors test helper infrastructure and adds annotations with zero behavioral impact. The TrackingListener refactoring consolidates event tracking logic and introduces checkpoint-based assertions for cleaner incremental event testing. No production code behavior changes; null annotations are purely for static analysis. All test patterns are correctly ported to the new API.

Was this helpful? React 👍 or 👎

📊 Validated against 5 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 726b66e · What is Autotest? · Any feedback? Reach out in #autotest

@mcculls mcculls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice test improvements, thanks!

@datadog-prod-us1-3

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.91 s 14.04 s [-1.6%; -0.2%] (maybe better)
startup:insecure-bank:tracing:Agent 12.91 s 13.03 s [-1.7%; -0.1%] (maybe better)
startup:petclinic:appsec:Agent 16.84 s 16.06 s [+0.6%; +9.2%] (maybe worse)
startup:petclinic:iast:Agent 16.36 s 16.93 s [-7.6%; +0.8%] (no difference)
startup:petclinic:profiling:Agent 16.87 s 16.91 s [-1.4%; +0.9%] (no difference)
startup:petclinic:sca:Agent 16.41 s 16.89 s [-7.2%; +1.5%] (no difference)
startup:petclinic:tracing:Agent 16.06 s 16.28 s [-2.3%; -0.4%] (maybe better)

Commit: 726b66e3 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@PerfectSlayer

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 2, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-02 12:11:24 UTC ℹ️ Start processing command /merge


2026-07-02 12:11:33 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-07-02 12:37:09 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-07-02 14:12:08 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit ac29db2 into master Jul 2, 2026
586 of 589 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the bbujon/context-continuation-tests-slim branch July 2, 2026 14:12
@github-actions github-actions Bot added this to the 1.64.0 milestone Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: context propagation Trace context propagation tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants