You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/06/15 18:24:15 UTC

incubator-tinkerpop git commit: less stringent GraphComputerTest on threading timing. Two threads can update the AtomicLong at the same nano-time.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master f98d0744d -> e656a79cb


less stringent GraphComputerTest on threading timing. Two threads can update the AtomicLong at the same nano-time.


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

Branch: refs/heads/master
Commit: e656a79cb42c65f33208820e5cc86a5256d898b4
Parents: f98d074
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jun 15 10:24:07 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jun 15 10:24:07 2015 -0600

----------------------------------------------------------------------
 .../gremlin/process/computer/GraphComputerTest.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e656a79c/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 010f369..42d0aa4 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -1026,7 +1026,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
             final long time = System.nanoTime();
             if (!memory.isInitialIteration())
                 assertNotEquals(-1l, TIME_KEEPER.get());
-            assertTrue(TIME_KEEPER.getAndSet(time) < time);
+            assertTrue(TIME_KEEPER.getAndSet(time) <= time);
             try {
                 memory.set("test", memory.getIteration());
                 fail("Should throw an immutable memory exception");
@@ -1041,7 +1041,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
             memory.set("test", memory.getIteration() + 1);
             sleep(10);
             assertNotEquals(-1l, TIME_KEEPER.get());
-            assertTrue(TIME_KEEPER.get() < System.nanoTime());
+            assertTrue(TIME_KEEPER.get() <= System.nanoTime());
         }
 
         @Override
@@ -1053,7 +1053,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
         public void workerIterationEnd(final Memory memory) {
             assertEquals(memory.getIteration(), memory.<Integer>get("test").intValue());
             assertNotEquals(-1l, TIME_KEEPER.get());
-            assertTrue(TIME_KEEPER.getAndSet(Long.MIN_VALUE) < System.nanoTime());
+            assertTrue(TIME_KEEPER.getAndSet(Long.MIN_VALUE) <= System.nanoTime());
             try {
                 memory.set("test", memory.getIteration());
                 fail("Should throw an immutable memory exception");
@@ -1098,7 +1098,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
         public void workerStart(final Stage stage) {
             final long time = System.nanoTime();
             if (!stage.equals(Stage.MAP)) assertNotEquals(-1l, TIME_KEEPER.get());
-            assertTrue(TIME_KEEPER.getAndSet(time) < time);
+            assertTrue(TIME_KEEPER.getAndSet(time) <= time);
             WORKER_START.add(stage);
             if (!stage.equals(Stage.MAP))
                 assertFalse(WORKER_END.isEmpty());
@@ -1110,7 +1110,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
             sleep(10);
             assertNotEquals(-1l, TIME_KEEPER.get());
             final long time = System.nanoTime();
-            assertTrue(TIME_KEEPER.getAndSet(time) < time);
+            assertTrue(TIME_KEEPER.getAndSet(time) <= time);
             assertEquals(1, WORKER_START.size());
             assertTrue(WORKER_START.contains(Stage.MAP));
         }
@@ -1121,7 +1121,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
             sleep(10);
             assertNotEquals(-1l, TIME_KEEPER.get());
             final long time = System.nanoTime();
-            assertTrue(TIME_KEEPER.getAndSet(time) < time);
+            assertTrue(TIME_KEEPER.getAndSet(time) <= time);
             assertEquals(2, WORKER_START.size());
             assertTrue(WORKER_START.contains(Stage.MAP) && WORKER_START.contains(Stage.COMBINE));
             assertFalse(WORKER_END.isEmpty());
@@ -1133,7 +1133,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
             sleep(10);
             assertNotEquals(-1l, TIME_KEEPER.get());
             final long time = System.nanoTime();
-            assertTrue(TIME_KEEPER.getAndSet(time) < time);
+            assertTrue(TIME_KEEPER.getAndSet(time) <= time);
             if (WORKER_START.size() == 2) {
                 assertEquals(2, WORKER_START.size());
                 assertTrue(WORKER_START.contains(Stage.MAP) && WORKER_START.contains(Stage.REDUCE));
@@ -1148,7 +1148,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest {
         public void workerEnd(final Stage stage) {
             assertNotEquals(-1l, TIME_KEEPER.get());
             final long time = System.nanoTime();
-            assertTrue(TIME_KEEPER.get() < time);
+            assertTrue(TIME_KEEPER.get() <= time);
             assertFalse(WORKER_START.isEmpty());
             if (!stage.equals(Stage.MAP))
                 assertFalse(WORKER_END.isEmpty());