Skip to content
Permalink
Browse files
Fix TestDropResourceMetricsReset (#2011)
Add a temp workaround by manually triggering a CurrentStageChange event for ExternalViewStage computation so that resource monitor can be cleaned up in unit test.
  • Loading branch information
qqu0127 committed Apr 5, 2022
1 parent 9c70bb0 commit ed9e3cb408b24644279c07cbcde4e56ac6d2dd06
Showing 1 changed file with 8 additions and 0 deletions.
@@ -148,11 +148,19 @@ public void testDropWithNoCurrentState() throws Exception {
// Drop the resource
setupTool.dropResourceFromCluster(clusterName, RESOURCE_NAME);

// TEMP WORKAROUND
// Adding a liveinstance has an effect of creating a CurrentStageChange event, which in turn triggers
// ExternalViewStage that includes the metric cleanup logic
// TODO: Fix and cleanup by refactoring mbean unregistration logic
// https://github.com/apache/helix/issues/1980
participant.syncStart();

// Verify that the bean was removed
noTimeout = _unregisterLatch.await(30000, TimeUnit.MILLISECONDS);
Assert.assertTrue(noTimeout);

// Clean up
participant.syncStop();
listener.disconnect();
controller.syncStop();

0 comments on commit ed9e3cb

Please sign in to comment.