mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-29 09:28:53 +00:00
Test with two threads at least #128
This commit is contained in:

committed by
Guillaume Nodet

parent
8efcf615d8
commit
4392dd6b3d
@@ -68,6 +68,10 @@ public class NativeTestClient implements Client {
|
||||
cmd.add("-s");
|
||||
cmd.add(settings.toString());
|
||||
}
|
||||
if (args.stream().noneMatch(arg -> arg.startsWith("-T") || arg.equals("--threads"))) {
|
||||
final int threads = Math.max(Runtime.getRuntime().availableProcessors() - 1, TestLayout.TEST_MIN_THREADS);
|
||||
cmd.add("-T" + threads);
|
||||
}
|
||||
|
||||
final ProcessBuilder builder = new ProcessBuilder(cmd.toArray(new String[0]))
|
||||
.directory(layout.userDir().toFile()) //
|
||||
|
@@ -19,13 +19,14 @@ import java.nio.file.Path;
|
||||
import org.jboss.fuse.mvnd.client.ClientLayout;
|
||||
|
||||
public class TestLayout extends ClientLayout {
|
||||
static final int TEST_MIN_THREADS = 2;
|
||||
private final Path testDir;
|
||||
|
||||
public TestLayout(Path testDir, Path mvndPropertiesPath, Path mavenHome, Path userDir, Path multiModuleProjectDirectory,
|
||||
Path javaHome, Path localMavenRepository, Path settings, Path logbackConfigurationPath,
|
||||
int idleTimeout, int keepAlive, int maxLostKeepAlive) {
|
||||
super(mvndPropertiesPath, mavenHome, userDir, multiModuleProjectDirectory, javaHome, localMavenRepository,
|
||||
settings, logbackConfigurationPath, idleTimeout, keepAlive, maxLostKeepAlive);
|
||||
settings, logbackConfigurationPath, idleTimeout, keepAlive, maxLostKeepAlive, TEST_MIN_THREADS);
|
||||
this.testDir = testDir;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user