Commit 5358bba
authored
Fix flaky RemoteRoutingTableServiceTests.testGetAsyncIndexRoutingTableDiffReadAction (#20618)
The test was failing intermittently with CorruptStateException due to
the mock returning the same stateful InputStream instance in a loop in a
test case. Changed the mock from thenReturn() to thenAnswer() to
generate a fresh input stream for each invocation.
Similarly, a CountdownLatch was being reused within the loop, but would
have been blocking only on the first iteration. Moved the latch to be
initialized inside each loop iteration.
Signed-off-by: Andrew Ross <andrross@amazon.com>1 parent 2c1cb01 commit 5358bba
File tree
1 file changed
+5
-5
lines changed- server/src/test/java/org/opensearch/cluster/routing/remote
1 file changed
+5
-5
lines changedLines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
615 | | - | |
| 614 | + | |
| 615 | + | |
616 | 616 | | |
617 | 617 | | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
| |||
0 commit comments