Force startedIterating before sleep

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

Branch: refs/heads/TINKERPOP-1274
Commit: 0787e46097cc09bb278ac1c787c4a50ece81cdb0
Parents: 82afed3
Author: Bryn Cooke <brynco...@gmail.com>
Authored: Mon Jun 27 22:14:37 2016 +0100
Committer: Bryn Cooke <brynco...@gmail.com>
Committed: Mon Jun 27 23:18:17 2016 +0100

----------------------------------------------------------------------
 .../gremlin/process/traversal/TraversalInterruptionTest.java      | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0787e460/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalInterruptionTest.java
----------------------------------------------------------------------
diff --git 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalInterruptionTest.java
 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalInterruptionTest.java
index c508df2..b0da10e 100644
--- 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalInterruptionTest.java
+++ 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalInterruptionTest.java
@@ -76,10 +76,9 @@ public class TraversalInterruptionTest extends 
AbstractGremlinProcessTest {
         final CountDownLatch startedIterating = new CountDownLatch(1);
         final Thread t = new Thread(() -> {
             try {
-                final AtomicBoolean first = new AtomicBoolean(true);
                 final Traversal traversal = 
traversalAfterPause.apply(traversalBeforePause.apply(g).sideEffect(traverser -> 
{
                     // let the first iteration flow through
-                    if (!first.compareAndSet(true, false)) {
+                    if (startedIterating.getCount() == 0) {
                         // ensure that the whole traversal doesn't iterate out 
before we get a chance to interrupt
                         // the next iteration should stop so we can force the 
interrupt to be handled by VertexStep
                         try {

Reply via email to