Fix unit test testFailsHealthOnHungIOBeyondHealthyTimeout() by incresing the max waiting time before assertion (#1692)
* Increase the max waiting time before checking the FS health after restoring the FS status in the test Signed-off-by: Tianli Feng <ftianli@amazon.com> * Remove another duplicate assetion statement Signed-off-by: Tianli Feng <ftianli@amazon.com>
This commit is contained in:
parent
e0e6995c4a
commit
baa10b9b20
|
@ -222,12 +222,10 @@ public class FsHealthServiceTests extends OpenSearchTestCase {
|
|||
disruptFileSystemProvider.injectIODelay.set(true);
|
||||
final FsHealthService fsHealthSrvc = new FsHealthService(settings, clusterSettings, testThreadPool, env);
|
||||
fsHealthSrvc.doStart();
|
||||
assertTrue(
|
||||
waitUntil(
|
||||
() -> fsHealthSrvc.getHealth().getStatus() == UNHEALTHY,
|
||||
healthyTimeoutThreshold + (2 * refreshInterval),
|
||||
TimeUnit.MILLISECONDS
|
||||
)
|
||||
waitUntil(
|
||||
() -> fsHealthSrvc.getHealth().getStatus() == UNHEALTHY,
|
||||
healthyTimeoutThreshold + (2 * refreshInterval),
|
||||
TimeUnit.MILLISECONDS
|
||||
);
|
||||
fsHealth = fsHealthSrvc.getHealth();
|
||||
assertEquals(UNHEALTHY, fsHealth.getStatus());
|
||||
|
@ -236,12 +234,10 @@ public class FsHealthServiceTests extends OpenSearchTestCase {
|
|||
assertThat(disruptedPathCount, equalTo(1));
|
||||
logger.info("--> Fix file system disruption");
|
||||
disruptFileSystemProvider.injectIODelay.set(false);
|
||||
assertTrue(
|
||||
waitUntil(
|
||||
() -> fsHealthSrvc.getHealth().getStatus() == HEALTHY,
|
||||
delayBetweenChecks + (2 * refreshInterval),
|
||||
TimeUnit.MILLISECONDS
|
||||
)
|
||||
waitUntil(
|
||||
() -> fsHealthSrvc.getHealth().getStatus() == HEALTHY,
|
||||
delayBetweenChecks + (3 * refreshInterval),
|
||||
TimeUnit.MILLISECONDS
|
||||
);
|
||||
fsHealth = fsHealthSrvc.getHealth();
|
||||
assertEquals(HEALTHY, fsHealth.getStatus());
|
||||
|
|
Loading…
Reference in New Issue