Skip to content

Conversation

giortzisg
Copy link
Contributor

Description

This aims to fix flakiness of TestHTTPTransportDoesntLeakGoroutines. The test would report goroutines stuck in network I/O operations, where the http.DefaultClient would hang and then the goleak.VerifyNone would incorrectly spot them as leaked goroutines on the transport. The solution is adding a mockTransport to each test client we create on the tests.

In addition also added a small fix that might also cause goroutine issues. When using the time.After func, a goroutine would be spawned. Using ctx.Done() eliminates the goroutine and also improves readability.

@giortzisg giortzisg requested a review from cleptric August 14, 2025 10:12
@giortzisg giortzisg self-assigned this Aug 14, 2025
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Aug 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.79%. Comparing base (6fa7ff4) to head (5383f4b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1071      +/-   ##
==========================================
- Coverage   87.08%   86.79%   -0.29%     
==========================================
  Files          55       55              
  Lines        5971     5962       -9     
==========================================
- Hits         5200     5175      -25     
- Misses        630      643      +13     
- Partials      141      144       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cursor[bot]

This comment was marked as outdated.

@giortzisg giortzisg merged commit e6bbe0f into master Aug 14, 2025
18 checks passed
@giortzisg giortzisg deleted the fix-flaky-tests branch August 14, 2025 12:05
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