Skip to content

test: reduce sidecar testing flakes - #4186

Open
morrisonlevi wants to merge 3 commits into
masterfrom
levi/agent-sampling-sidecar-race
Open

test: reduce sidecar testing flakes#4186
morrisonlevi wants to merge 3 commits into
masterfrom
levi/agent-sampling-sidecar-race

Conversation

@morrisonlevi

Copy link
Copy Markdown
Collaborator

Description

This fixes two different sidecar flakes.

  1. inWebServer() retries the entire server lifecycle when no traces are received, but testComposerInteroperabilityWhenNoInitHook expects no traces. It then kills a healthy PHP server and immediately restarts it on the same port. With telemetry enabled, the extension can start a sidecar that briefly outlives the forcibly stopped PHP process and may retain the server socket. The unnecessary retry then fails with Server never came up. Fixed by setting retries=0 for this test. There are no other tests I could find that also assert that no traces are made.
  2. Fixes a race in the agent_sampling_sidecar.phpt caused by matching stale shared-memory data from earlier or parallel test processes. Each invocation now uses unique sampling configuration markers, ensuring
    it waits for its own sidecar updates. Failures also report concise, actionable messages instead of dumping large shared-memory buffers.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Sep 11, 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.

🚦 10 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | check libxml2 version — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [8.4] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-php | test_metrics: [7.4, cgi-fcgi] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

View all 10 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 55.03% (+0.00%)

Useful? React with 👍 / 👎

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a specific reason you dropped the debuggability of this test? Otherwise probably fine.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I guess you consider hexdumps more debuggable than messages? xD
I can revert that aspect, sure.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not both :-P

@morrisonlevi
morrisonlevi marked this pull request as ready for review September 11, 2026 23:52
@morrisonlevi
morrisonlevi requested review from a team as code owners September 11, 2026 23:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 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-11T23:55:21.866683Z b92e6bc Draft marked ready
🔒 Security Review Completed 2026-09-11T23:56:27.145135Z b92e6bc Draft marked ready
ℹ️ 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.

@morrisonlevi
morrisonlevi enabled auto-merge (squash) September 13, 2026 16:58
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.

2 participants