Skip to content

Fix flaky test: TestO11y/http_with_token #1248

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.

📋 Tests Fixed

  • o11y/otel/otel_test.go: Fixed race condition in TestO11y/http_with_token subtest by adding proper polling pattern for trace retrieval from Jaeger

⚠️ Tests Analyzed But Not Fixed

None. The single analyzed test was successfully fixed.

🛠️ Types of Changes Made

  • Timing fixes: 1 test affected (added polling pattern to eliminate race condition)

🔍 Common Patterns Identified

The test exhibited timing-based flakiness due to a race condition between trace creation/flushing and trace retrieval from Jaeger. The fix involved implementing a proven polling pattern already used elsewhere in the codebase.

✅ Expected Impact

This targeted fix should improve test reliability by addressing the race condition where the "find trace" subtest was directly querying Jaeger without waiting for traces to be indexed, causing intermittent failures when Jaeger hadn't processed the traces yet.


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

@circleci-app circleci-app bot requested a review from a team as a code owner August 6, 2025 13:49
Comment on lines +138 to +141
if len(traces) >= 1 {
return poll.Success()
}
return poll.Continue("only got %d traces", len(traces))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if len(traces) >= 1 {
return poll.Success()
}
return poll.Continue("only got %d traces", len(traces))
return poll.Compare(cmp.Len(traces, 1))

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.

1 participant