Add additional check to Thread.sleep to make test correct in all cases. - Fixes
@@ -32,6 +32,7 @@ import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.util.typedef.CI1;
import org.apache.ignite.internal.util.typedef.CI2;
+import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
@@ -428,6 +429,9 @@ public class IgniteOptimisticTxSuspendResumeTest extends GridCommonAbstractTest
tx.suspend();
+ long start = U.currentTimeMillis();
+
+ while(TX_TIMEOUT >= U.currentTimeMillis() - start)
Thread.sleep(TX_TIMEOUT * 2);
GridTestUtils.assertThrowsWithCause(new Callable<Object>() {
@@ -459,6 +463,9 @@ public class IgniteOptimisticTxSuspendResumeTest extends GridCommonAbstractTest
cache.put(1, 1);
+ long start = U.currentTimeMillis();
+
+ while(TX_TIMEOUT >= U.currentTimeMillis() - start)
Thread.sleep(TX_TIMEOUT * 2);
GridTestUtils.assertThrowsWithCause(new Callable<Object>() {
