Skip to content

Fix flaky test: TestO11y/http_with_token/find_trace #1249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

circleci-app[bot]
Copy link

@circleci-app circleci-app bot commented Aug 6, 2025

🔧 Flaky Tests Analysis & Fixes

This PR contains a fix for one flaky test that was causing reliability issues due to timing-based race conditions in OpenTelemetry trace processing.

📋 Tests Fixed

  • o11y/otel/otel_test.go: Fixed timing-based flakiness in TestO11y/http_with_token/find_trace by replacing immediate Jaeger query with proper polling mechanism to wait for traces to be available

⚠️ Tests Analyzed But Not Fixed

None - the single identified flaky test was successfully analyzed and fixed.

🛠️ Types of Changes Made

  • Timing fixes: 1 test - implemented poll.WaitOn pattern to eliminate race condition
  • Test stability improvements: 1 test - replaced immediate trace query with proper asynchronous waiting

🔍 Common Patterns Identified

The flakiness was caused by a classic timing issue where the test queried Jaeger for traces immediately after sending them, but before they were fully flushed and indexed in the backend. This created a race condition where the test would sometimes find the trace and sometimes not.

✅ Expected Impact

These targeted fixes should improve test reliability by addressing timing-based race conditions in OpenTelemetry trace processing and ensuring proper synchronization with the Jaeger backend.


Total Tests Analyzed: 1 | Successfully Fixed: 1 | Test Files Modified: 1 | Total Cost: $0.91 | Generated: 2025-08-06

@circleci-app circleci-app bot requested a review from a team as a code owner August 6, 2025 13:55
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.

0 participants