Skip to content

Fix Kotlin coroutine test scope crossing suspension - #12679

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
andrea.marziali/kotlinx-flaky
Sep 30, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
andrea.marziali/kotlinx-flaky

Conversation

@amarziali

Copy link
Copy Markdown
Contributor

What Does This Do

Moves delay(1) outside the manually activated child-span scopes in the lazy coroutine test.

A coroutine may resume on another worker after suspension. Keeping a thread-bound scope open across delay allowed it to be closed from a different thread, producing a flaky CLOSE_WRONG_THREAD / NEVER_CLOSED
diagnostic.

  flowchart LR
      A[Worker A activates span scope] --> B[Increment counter]
      B --> C[Close scope on Worker A]
      C --> D[delay suspends coroutine]
      D --> E[Coroutine may resume on Worker B]
Loading

The test still exercises coroutine suspension and parent-span inheritance without carrying a manually activated scope across a suspension point.

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:35
@amarziali amarziali added the type: bug fix Bug fix label Sep 29, 2026
@amarziali
amarziali requested review from ygree and removed request for a team September 29, 2026 09:35
@amarziali amarziali added tag: no release notes Changes to exclude from release notes tag: flaky test Flaky tests inst: kotlin Kotlin 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:38:02.480835Z ccdaf0d PR opened
🔒 Security Review ✅ Completed 2026-09-29T09:37:55.868638Z ccdaf0d 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.

@datadog-prod-us1-5 datadog-prod-us1-5 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 manually activated child-span scopes now close before each coroutine suspension, avoiding cross-thread closure while retaining lazy-start and suspension coverage.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit ccdaf0d · @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 14.04 s 14.01 s [-0.5%; +1.0%] (no difference)
startup:insecure-bank:tracing:Agent 12.97 s 13.06 s [-1.5%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.05 s 16.94 s [-0.3%; +1.6%] (no difference)
startup:petclinic:iast:Agent 16.95 s 17.00 s [-1.2%; +0.6%] (no difference)
startup:petclinic:profiling:Agent 16.62 s 16.75 s [-1.9%; +0.3%] (no difference)
startup:petclinic:sca:Agent 16.87 s 16.34 s [-1.2%; +7.8%] (no difference)
startup:petclinic:tracing:Agent 16.23 s 15.73 s [-1.0%; +7.3%] (no difference)

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

@ygree ygree 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.

Good catch

@amarziali

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-30 07:48:13 UTC ℹ️ Start processing command /merge


2026-09-30 07:48:23 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-09-30 11:52:09 UTC ⚠️ MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

@amarziali

Copy link
Copy Markdown
Contributor Author

/code blockers

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-30 11:52:47 UTC ℹ️ Start processing command /code blockers


2026-09-30 11:52:48 UTC ℹ️ Devflow:

Checking merge blockers for #12679...


2026-09-30 11:52:52 UTC ℹ️ Devflow: /code blockers

No merge blockers detected.

@amarziali

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-30 11:53:05 UTC ℹ️ Start processing command /merge


2026-09-30 11:53:14 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-09-30 15:45:08 UTC ℹ️ MergeQueue: merge request added to the queue

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


2026-09-30 16:51:27 UTC ℹ️ MergeQueue: This merge request was merged

@amarziali amarziali added inst: kotlin Kotlin instrumentation and removed inst: kotlin Kotlin instrumentation labels Sep 30, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit bb90ad3 into master Sep 30, 2026
616 of 621 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/kotlinx-flaky branch September 30, 2026 16:51
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: kotlin Kotlin 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