Skip to content

Commit e48d44c

Browse files
committed
HSEARCH-1786 Improve ConcurrentRunner to fail eagerly even on AssertionError(s)
1 parent ca729ba commit e48d44c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

engine/src/test/java/org/hibernate/search/testsupport/concurrency/ConcurrentRunner.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,12 @@ public WrapRunnable(CountDownLatch startLatch, CountDownLatch endLatch, Runnable
9999
public void run() {
100100
try {
101101
startLatch.await(); // Maximize chances of working concurrently on the Serializer
102-
userRunnable.run();
102+
//Prevent more work to be scheduled if something failed already
103+
if ( somethingFailed.get() == false ) {
104+
userRunnable.run();
105+
}
103106
}
104-
catch (InterruptedException | RuntimeException e) {
107+
catch (InterruptedException | RuntimeException | AssertionError e) {
105108
e.printStackTrace();
106109
somethingFailed.set( true );
107110
}

0 commit comments

Comments
 (0)