Skip to content

fix: add sleep after HTTP server stop in health check test to avoid race condition#1661

Closed
josecelano wants to merge 2 commits intotorrust:developfrom
josecelano:fix/health-check-http-test-race-condition
Closed

fix: add sleep after HTTP server stop in health check test to avoid race condition#1661
josecelano wants to merge 2 commits intotorrust:developfrom
josecelano:fix/health-check-http-test-race-condition

Conversation

@josecelano
Copy link
Member

The test it_should_return_error_when_http_service_was_stopped_after_registration was flaky on nightly Rust because the OS can keep a TCP port in CLOSE_WAIT/TIME_WAIT briefly after the server stops, causing the health check to still return Ok instead of Error.\n\nAdds a 100ms sleep after stop().await to let the OS fully release the TCP port before the health check runs.

@josecelano josecelano self-assigned this Mar 3, 2026
@josecelano
Copy link
Member Author

ACK 2d65b09

@josecelano
Copy link
Member Author

The testing workflow failed in this PR.

1 similar comment
@josecelano
Copy link
Member Author

The testing workflow failed in this PR.

@josecelano josecelano closed this Mar 3, 2026
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.42%. Comparing base (194f039) to head (2d65b09).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1661      +/-   ##
===========================================
- Coverage    86.47%   86.42%   -0.05%     
===========================================
  Files          288      288              
  Lines        22672    22672              
  Branches     22672    22672              
===========================================
- Hits         19605    19594      -11     
- Misses        2839     2846       +7     
- Partials       228      232       +4     

☔ 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.

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