Skip to content

Commit

Permalink
Workaround Liberty Gradle issue within single-thread test execution
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Kurz <[email protected]>
  • Loading branch information
scottkurz committed Jul 18, 2023
1 parent d2c48df commit 580c260
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public void testRuntime(String supportedServer, String artifactId, SpecSelection
File runLogA = null;
File runLogB = null;

// Workaround https://github.com/OpenLiberty/ci.gradle/issues/841 by using a single-thread for Liberty + Gradle
int threadPoolSize = (supportedServer.equalsIgnoreCase("LIBERTY") && buildTool.equals(BuildTool.GRADLE)) ? 1 : 2;

try {
// Cleanup
cleanWorkspace(artifactId);
Expand Down Expand Up @@ -134,7 +137,7 @@ public void testRuntime(String supportedServer, String artifactId, SpecSelection
if (specSelection.hasServiceB) {
buildLogB = new File(directoryB.getAbsolutePath() + File.separator + directoryB.getName() + "-build.log");
}
ExecutorService buildService = Executors.newFixedThreadPool(2);
ExecutorService buildService = Executors.newFixedThreadPool(threadPoolSize);
buildService.submit(new Commands.ProcessRunner(directoryA, buildLogA, buildCmdRunCmdWebAddr[0], 20));
if (specSelection.hasServiceB) {
buildService.submit(new Commands.ProcessRunner(directoryB, buildLogB, buildCmdRunCmd[0], 20));
Expand Down

0 comments on commit 580c260

Please sign in to comment.