Skip to content

fix: resolve flaky integration test timing issues#3502

Closed
tippmar-nr wants to merge 1 commit intomainfrom
fix/flaky-integration-test-timing
Closed

fix: resolve flaky integration test timing issues#3502
tippmar-nr wants to merge 1 commit intomainfrom
fix/flaky-integration-test-timing

Conversation

@tippmar-nr
Copy link
Copy Markdown
Member

Summary

  • GCSamplerV2 tests: Add GC.Collect(0) calls so the V2 per-generation subtraction logic reliably reports non-zero Gen0 collections on fast-starting CI processes.
  • OTel metrics tests: Wait for OTLP export log (every 5s) instead of analytic_event_data (every 60s), eliminating a race where the 60s harvest fires just past the 60s WaitForLogLine timeout.
  • OTel stress tests: Replace 60s analytics wait + 45s Thread.Sleep with a wait for 3 OTLP exports, cutting exercise time from ~123s to ~20s.

Test plan

  • Run OpenTelemetryMetricsTests suite — all variants should pass without 60s timeout flakiness
  • Run OpenTelemetryStressTests suite — should complete in ~30s instead of ~2.5min
  • Run AgentMetrics suite — GCSamplerV2 tests should pass consistently

🤖 Generated with Claude Code

- GCSamplerV2 tests: add Gen0-only GC.Collect(0) calls so the V2
  per-generation subtraction logic reliably reports non-zero Gen0
  collections regardless of startup timing.

- OTel metrics tests: wait for the OTLP export log line (fires every
  5s) instead of analytic_event_data (fires at ~60s), which races
  with the 60-second WaitForLogLine timeout on slow CI machines.

- OTel stress tests: replace the 60s analytics wait + 45s Thread.Sleep
  with a wait for 3 OTLP exports (~15s), cutting exercise time from
  ~123s to ~20s.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tippmar-nr tippmar-nr closed this Mar 24, 2026
@tippmar-nr tippmar-nr deleted the fix/flaky-integration-test-timing branch March 24, 2026 14:54
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.79%. Comparing base (425cdd1) to head (50c958a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3502   +/-   ##
=======================================
  Coverage   81.79%   81.79%           
=======================================
  Files         508      508           
  Lines       34220    34220           
  Branches     4040     4040           
=======================================
  Hits        27990    27990           
  Misses       5265     5265           
  Partials      965      965           
Flag Coverage Δ
Profiler 71.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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