[Test Optimization] Fix MSTest 4.4.0 discovery and native retries - #9192
[Test Optimization] Fix MSTest 4.4.0 discovery and native retries#9192tonyredondo wants to merge 24 commits into
Conversation
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9192) and master. ✅ No regressions detected |
BenchmarksBenchmark execution time: 2026-09-10 10:30:30 Comparing candidate commit 31c3e4f in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 63 known flaky benchmarks, 63 flaky benchmarks without significant changes.
|
c5a435d to
1c53f48
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9192) and master. ✅ No regressions detected |
46c2b75 to
21e51d4
Compare
94e1a9d to
619b5a4
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f228ad7b30
ℹ️ 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".
Summary of changes
Restore MSTest 4.4.0 discovery counts and record each native retry attempt, assigning
final_statusonly to the final span for each test. Preserve older MSTest cleanup paths and report cleanup failures before the suite closes. Builds on #9189, already in master.Reason for change
MSTest 4.4 changed discovery and native retry execution. Its policy selects results before class cleanup, so Datadog retries must run while row inputs and the framework lifecycle remain available.
The compatibility review also found missing cleanup hooks in MSTest 2.0–2.2.7 and returned cleanup exceptions in 3.8–3.10. Cleanup errors could leave a suite marked as passed or be reported again after its span had closed.
Implementation details
Test: finish coverage and callbacks once, retain the captured duration, then assign final retry tags and close the span under the same guard as shutdown. Selenium uses the execution-completion callback so RUM flushing still happens while the attempt context is active.TestOptimization.ShutdownAsynchook before agent discovery can initialize the tracer, so sessions finish before their writer closes.Test coverage
Area=CIVisibilityto match the CI job routing.The eight duplicate-row regressions failed against the previous production binaries: two independent rows produced only one
final_status. With the correction, all eight regressions and the complete 86-case native retry suite pass locally without skips. All four managed tracer targets and the .NET 8 integration project compile without warnings or errors. The 28 relevant lifecycle/instrumentation unit tests pass, and the .NET Framework integration project cross-compiles successfully; its Windows runtime validation remains pending.Earlier CI validation for
f228ad7b30(before the duplicate-row correction):The duplicate-row correction still requires CI validation on Windows. The earlier results above do not validate this new change.
Other details
Temporary gzip capture code, configuration, tests and pipeline steps have been removed. The intermittent Windows x86/.NET 8 event-delivery failure did not recur in the completed run, but its cause remains unexplained; this PR does not claim a compression fix.
The microbenchmark report still flags a 6.2–6.6% throughput regression in
HttpClientBenchmark.SendAsyncon net472 against master9d742a23. Its relationship to this change is unconfirmed. The separate execution-time benchmark report found no regressions.