Fixed unit test failed with
This closes
@@ -40,6 +40,7 @@ import org.apache.nifi.provenance.store.ArrayListEventStore;
import org.apache.nifi.provenance.store.EventStore;
import org.apache.nifi.provenance.store.StorageResult;
import org.apache.nifi.util.Tuple;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
@@ -83,6 +84,11 @@ public class TestLuceneEventIndex {
return System.getProperty("os.name").toLowerCase().startsWith("windows");
}
+ @Before
+ public void setup() {
+ idGenerator.set(0L);
+ }
+
@Test
public void testGetTimeRange() {
final long now = System.currentTimeMillis();
@@ -170,7 +176,7 @@ public class TestLuceneEventIndex {
}
@Test(timeout = 60000)
- public void testUnauthorizedEventsGetPlaceholdersForExpandChildren() throws InterruptedException {
+ public void testUnauthorizedEventsGetPlaceholdersForExpandChildren() throws InterruptedException, IOException {
assumeFalse(isWindowsEnvironment());
final RepositoryConfiguration repoConfig = createConfig(1);
repoConfig.setDesiredIndexSize(1L);
@@ -224,13 +230,15 @@ public class TestLuceneEventIndex {
List<LineageNode> nodes = Collections.emptyList();
while (nodes.size() < 5) {
- final ComputeLineageSubmission submission = index.submitExpandChildren(1L, user, allowForkEvents);
+ final ComputeLineageSubmission submission = index.submitExpandChildren(fork.getEventId(), user, allowForkEvents);
assertTrue(submission.getResult().awaitCompletion(15, TimeUnit.SECONDS));
nodes = submission.getResult().getNodes();
Thread.sleep(25L);
}
+ nodes.forEach(System.out::println);
+
assertEquals(5, nodes.size());
assertEquals(1L, nodes.stream().filter(n -> n.getNodeType() == LineageNodeType.FLOWFILE_NODE).count());
