Skip to content

Commit

Permalink
Run each integration test with unique executor group so that they do …
Browse files Browse the repository at this point in the history
…not conflict even if run concurrently or in random order
  • Loading branch information
gmokki committed Jan 11, 2022
1 parent afbff17 commit 5450042
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public static void start() throws Exception {
.prop("nflow.dispatcher.sleep.ms", 5)
.prop("nflow.dispatcher.sleep.ms", 2)
.springContextClass(DemoConfiguration.class).build());
servers.get(0).before();
servers.get(0).before("ConcurrentEnginesTest");
for (int i=1; i<ENGINES; ++i) {
NflowServerConfig server = servers.get(0).anotherServer();
servers.add(server);
server.before();
server.before("ConcurrentEnginesTest");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ public void setSpringContextClass(Class<?> springContextClass) {
this.springContextClass = springContextClass;
}

public void before() throws Exception {
public void before(String testName) throws Exception {
if (getInstanceName() == null) {
props.put("nflow.executor.group", testName);
}
startDb();
startJetty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void beforeAll(ExtensionContext context) throws Exception {
Field configField = fields.get(0);
config = (NflowServerConfig) configField.get(null);
logger.debug("Initialize with {}: {}", NflowServerConfig.class.getSimpleName(), config);
config.before();
config.before(testClass.getSimpleName());
}

@Override
Expand Down

0 comments on commit 5450042

Please sign in to comment.