Skip to content

Fix health check test failure caused by stale HealthManager state#377

Open
sunnywu wants to merge 1 commit intomainfrom
syw-fix-health-check-test
Open

Fix health check test failure caused by stale HealthManager state#377
sunnywu wants to merge 1 commit intomainfrom
syw-fix-health-check-test

Conversation

@sunnywu
Copy link
Contributor

@sunnywu sunnywu commented Feb 19, 2026

Summary

  • PartnerConfigMonitorV2Test.testLoadContent creates OptOutSender instances asynchronously inside loadContent(), then immediately calls testContext.completeNow() before the deployments complete
  • Each OptOutSender constructor registers a health component in the singleton HealthManager, initially setting it to false; start() normally sets it to true, but it never runs before Vertx closes
  • These stale unhealthy components persist in HealthManager.instance and cause OptOutServiceVerticleTest.getHealthCheck_expectOK to receive HTTP 503 instead of 200

Test plan

  • Run mvn clean test -Dtest=OptOutServiceVerticleTest — should pass with 0 failures
  • Run full CI pipeline — getHealthCheck_expectOK should no longer fail

🤖 Generated with Claude Code

PartnerConfigMonitorV2Test.testLoadContent creates OptOutSender instances
asynchronously and completes before their start() methods can set the
HealthManager components to healthy. These stale unhealthy components
persist in the singleton HealthManager and cause OptOutServiceVerticleTest
getHealthCheck_expectOK to receive 503 instead of 200.

Fix by calling HealthManager.instance.reset() in @BeforeClass to clear
any accumulated health components from previous tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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

Comments