Skip to content

Commit

Permalink
[bJ4pn0Bj] PeriodicTest.testTerminateCommit is flaky (neo4j-contrib#331)
Browse files Browse the repository at this point in the history
* [bJ4pn0Bj] PeriodicTest.testTerminateCommit is flaky

* [bJ4pn0Bj] removed Ignore in testTerminateCommit
  • Loading branch information
vga91 authored Feb 21, 2023
1 parent 8d765e4 commit 9a83638
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions core/src/test/java/apoc/periodic/PeriodicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import apoc.util.collection.Iterators;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.neo4j.common.DependencyResolver;
Expand Down Expand Up @@ -168,10 +167,9 @@ public void testSlottedRuntime() {

}

@Ignore
@Test
public void testTerminateCommit() {
PeriodicTestUtils.testTerminatePeriodicQuery(db, "CALL apoc.periodic.commit('UNWIND range(0,1000) as id WITH id CREATE (n:Foo {id: id}) RETURN n limit 1000', {})");
PeriodicTestUtils.testTerminatePeriodicQuery(db, "CALL apoc.periodic.commit('UNWIND range(0,1000) as id WITH id CREATE (n:Foo {id: id}) WITH n limit 1000 RETURN COUNT(n)', {})");
}

@Test
Expand Down
6 changes: 2 additions & 4 deletions test-utils/src/main/java/apoc/periodic/PeriodicTestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

import java.util.Map;

import static apoc.util.TestUtil.testResult;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.junit.Assert.assertTrue;

public class PeriodicTestUtils {
public static void killPeriodicQueryAsync(DbmsRule db) {
Expand Down Expand Up @@ -52,7 +50,7 @@ public static void testTerminatePeriodicQuery(DbmsRule db, String periodicQuery)
}),
(value) -> value, 15L, TimeUnit.SECONDS);
} catch(Exception tfe) {
assertEquals(tfe.getMessage(),true, tfe.getMessage().contains("terminated"));
assertTrue(tfe.getMessage(), tfe.getMessage().contains("terminated"));
}
}
}

0 comments on commit 9a83638

Please sign in to comment.