Commit 28b852d
authored
Fix faulty assertion in AutoForceMergeManagerTests (#19024)
This commit removes a non-deterministic sleep and properly asserts that
the AutoForceMergeManager completes quickly when interrupted. The
previous test logic had a race condition where it checked the interrupt
status of the thread, but that could return false if the thread was in
the process of catching the InterruptException but had not yet reset the
interrupt flag of the thread. The new logic is to set the delay to be
the maximum of 60 seconds and assert that the test thread exits more
quickly than that due to being interrupted.
Signed-off-by: Andrew Ross <andrross@amazon.com>1 parent 2f416d3 commit 28b852d
File tree
1 file changed
+9
-3
lines changed- server/src/test/java/org/opensearch/index/autoforcemerge
1 file changed
+9
-3
lines changedLines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
531 | 532 | | |
532 | 533 | | |
533 | 534 | | |
534 | | - | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
535 | 541 | | |
536 | 542 | | |
537 | 543 | | |
538 | 544 | | |
539 | 545 | | |
540 | | - | |
541 | 546 | | |
542 | | - | |
| 547 | + | |
| 548 | + | |
543 | 549 | | |
544 | 550 | | |
545 | 551 | | |
| |||
0 commit comments