Closed kaisun2000 closed 3 years ago
Change to this should work.
boolean result = TestHelper.verify(() -> {
MaintenanceSignal ms = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance());
return ms != null && ms.getReason() != null;
}, TestHelper.WAIT_DURATION);
Also fixed similar patter in TestClusterInMaintenanceModeWhenReachingOfflineInstancesLimit
Still have
2020-08-16T06:11:19.8375558Z [ERROR] TestClusterInMaintenanceModeWhenReachingOfflineInstancesLimit.testWithOfflineInstancesLimit:164 expected:
but was:
with previous test adding
ZkHelixClusterVerifier clusterVerifier =
new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient).build();
Thread.sleep(100);
Assert.assertTrue(clusterVerifier.verifyByPolling());
@Test(dependsOnMethods = "testWithDisabledInstancesLimit")
public void testWithOfflineInstancesLimit() throws Exception {
MaintenanceSignal maintenanceSignal =
_dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance());
Assert.assertNull(maintenanceSignal); ---> failure
Change to Thread.sleep from 200 to 2000. Consider add a default sleep period in ZkHelixClusterVerifier.verifyByPolling().
Note, BestPossibleExternalViewVerifier depends on enablePersistBestPossibleAssignment, right? Confirm.
Close test unstable tickets since we have an automatic tracking mechanism https://github.com/apache/helix/pull/1757 now for tracking the most recent test issues.
LOG:
Pure waiting, bad test? How to enhance?