Skip to content

Fix Spring WebFlux client flaky tests - #12677

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
andrea.marziali/flaky-webflux
Sep 29, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
andrea.marziali/flaky-webflux

Conversation

@amarziali

Copy link
Copy Markdown
Contributor

What Does This Do

Consumes Spring WebFlux client response bodies before returning from test requests.

exchange().block() can return after receiving the response headers while Reactor Netty is still processing channelReadComplete. Test cleanup could consequently observe the instrumentation scope opened by fireChannelReadComplete before its exit advice closed it.

Draining the response body ensures asynchronous response processing completes before the test ends.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@amarziali
amarziali requested a review from a team as a code owner September 29, 2026 09:17
@amarziali
amarziali requested review from vandonr and removed request for a team September 29, 2026 09:17
@amarziali amarziali added type: bug fix Bug fix tag: no release notes Changes to exclude from release notes tag: flaky test Flaky tests inst: spring Spring instrumentation labels Sep 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T09:22:40.618448Z 6e65acb PR opened
🔒 Security Review ✅ Completed 2026-09-29T09:19:33.206583Z 6e65acb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@amarziali amarziali changed the title Fix flaky Spring WebFlux client scope diagnostics Fix flaky Spring WebFlux client flaky tests Sep 29, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e65acbcbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-official datadog-official Bot 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.

Bits Code Review: FAIL

Blocking on bodyToMono(Void) does not order test cleanup after Netty’s later channelReadComplete callback, so the scope-diagnostic race this change targets can still occur.

Open Bits AI session

🤖 Bits Code Review · Commit 6e65acb · @DataDog review to ask questions

@dd-octo-sts

dd-octo-sts Bot commented Sep 29, 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.99 s 14.01 s [-0.9%; +0.6%] (no difference)
startup:insecure-bank:tracing:Agent 12.97 s 13.07 s [-1.6%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.04 s 16.95 s [-0.4%; +1.5%] (no difference)
startup:petclinic:iast:Agent 17.04 s 17.04 s [-0.7%; +0.7%] (no difference)
startup:petclinic:profiling:Agent 16.53 s 16.95 s [-3.4%; -1.5%] (significantly better)
startup:petclinic:sca:Agent 16.94 s 17.00 s [-1.2%; +0.6%] (no difference)
startup:petclinic:tracing:Agent 16.17 s 16.21 s [-1.0%; +0.5%] (no difference)

Commit: 6720e147 · 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.

@amarziali

Copy link
Copy Markdown
Contributor Author

@DataDog review

@datadog-official datadog-official Bot 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.

Bits Code Review: PASS

More details

The response helper drains each body and waits for queued Netty event-loop work before test cleanup; no concrete failure mode was identified in the changed call sites.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 6720e14 · @DataDog review to ask questions

@amarziali amarziali changed the title Fix flaky Spring WebFlux client flaky tests Fix Spring WebFlux client flaky tests Sep 29, 2026
@amarziali

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-29 13:18:41 UTC ℹ️ Start processing command /merge


2026-09-29 13:18:46 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-09-29 13:40:04 UTC ❌ MergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for cdd6b27:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@amarziali

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-29 14:03:38 UTC ℹ️ Start processing command /merge


2026-09-29 14:03:43 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-09-29 15:12:24 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit c6c12f1 into master Sep 29, 2026
608 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/flaky-webflux branch September 29, 2026 15:12
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: spring Spring instrumentation tag: flaky test Flaky tests tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants