ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [23/26] ignite git commit: ignite-1.5 Fixed test.
Date Thu, 10 Dec 2015 09:50:30 GMT
ignite-1.5 Fixed test.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f4ad1287
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f4ad1287
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f4ad1287

Branch: refs/heads/ignite-1537
Commit: f4ad1287044244964e4bf81a19337f71b7aebeb6
Parents: 6d7a6ea
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Dec 10 12:43:47 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Dec 10 12:43:47 2015 +0300

----------------------------------------------------------------------
 .../GridEventStorageCheckAllEventsSelfTest.java     | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f4ad1287/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
index 75ec7b7..00623fc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
@@ -40,11 +40,13 @@ import org.apache.ignite.events.Event;
 import org.apache.ignite.events.JobEvent;
 import org.apache.ignite.events.TaskEvent;
 import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.resources.LoggerResource;
 import org.apache.ignite.resources.TaskSessionResource;
+import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.testframework.junits.common.GridCommonTest;
 import org.jetbrains.annotations.Nullable;
@@ -271,13 +273,21 @@ public class GridEventStorageCheckAllEventsSelfTest extends GridCommonAbstractTe
      * to allow pass {@link IgniteUtils#currentTimeMillis()}.
      *
      * @return Call timestamp.
-     * @throws InterruptedException If sleep was interrupted.
+     * @throws Exception If failed.
      */
-    private long startTimestamp() throws InterruptedException {
-        long tstamp = System.currentTimeMillis();
+    private long startTimestamp() throws Exception {
+        final long tstamp = U.currentTimeMillis();
 
         Thread.sleep(20);
 
+        GridTestUtils.waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                return U.currentTimeMillis() > tstamp;
+            }
+        }, 5000);
+
+        assert U.currentTimeMillis() > tstamp;
+
         return tstamp;
     }
 


Mime
View raw message