Test Failed: IgnitePartitionedCountDownLatchSelfTest.testLatchMultinode1 - Fixes
@@ -26,6 +26,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Random;
import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.Ignite;
@@ -336,6 +337,8 @@ public abstract class IgniteCountDownLatchAbstractSelfTest extends IgniteAtomics
final AtomicBoolean countedDown = new AtomicBoolean();
+ CountDownLatch allLatchesObtained = new CountDownLatch(gridCount());
+
for (int i = 0; i < gridCount(); i++) {
final Ignite ignite = grid(i);
@@ -345,6 +348,8 @@ public abstract class IgniteCountDownLatchAbstractSelfTest extends IgniteAtomics
true,
false);
+ allLatchesObtained.countDown();
+
assertNotNull(latch);
boolean wait = latch.await(30_000);
@@ -361,9 +366,12 @@ public abstract class IgniteCountDownLatchAbstractSelfTest extends IgniteAtomics
}
for (int i = 0; i < 10; i++) {
- if (i == 9)
+ if (i == 9) {
countedDown.set(true);
+ allLatchesObtained.await();
+ }
+
latch.countDown();
}
