Skip to content

Commit

Permalink
Revert "Support running acceptance tests on Windows"
Browse files Browse the repository at this point in the history
This reverts commit 215a7b9.
  • Loading branch information
fab-10 committed Mar 26, 2024
1 parent d9475b6 commit a370514
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.junit.jupiter.api.AfterEach;
import org.junit.After;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** Superclass for acceptance tests. */
/**
* Superclass for acceptance tests. For now (transition to junit5 is ongoing) this class supports
* junit4 format.
*/
@ExtendWith(AcceptanceTestBaseTestWatcher.class)
public class AcceptanceTestBase {

Expand Down Expand Up @@ -128,7 +131,7 @@ protected AcceptanceTestBase() {
exitedSuccessfully = new ExitedWithCode(0);
}

@AfterEach
@After
public void tearDownAcceptanceTestBase() {
reportMemory();
cluster.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import org.apache.commons.lang3.SystemUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
Expand All @@ -78,15 +77,8 @@ public void startNode(final BesuNode node) {

final Path dataDir = node.homeDirectory();

final var workingDir =
new File(System.getProperty("user.dir")).getParentFile().getParentFile().toPath();

final List<String> params = new ArrayList<>();
if (SystemUtils.IS_OS_WINDOWS) {
params.add(workingDir.resolve("build\\install\\besu\\bin\\besu.bat").toString());
} else {
params.add("build/install/besu/bin/besu");
}
params.add("build/install/besu/bin/besu");

params.add("--data-path");
params.add(dataDir.toAbsolutePath().toString());
Expand Down Expand Up @@ -430,13 +422,15 @@ public void startNode(final BesuNode node) {
LOG.info("Creating besu process with params {}", params);
final ProcessBuilder processBuilder =
new ProcessBuilder(params)
.directory(workingDir.toFile())
.directory(new File(System.getProperty("user.dir")).getParentFile().getParentFile())
.redirectErrorStream(true)
.redirectInput(Redirect.INHERIT);
if (!node.getPlugins().isEmpty()) {
processBuilder
.environment()
.put("BESU_OPTS", "-Dbesu.plugins.dir=" + dataDir.resolve("plugins").toAbsolutePath());
.put(
"BESU_OPTS",
"-Dbesu.plugins.dir=" + dataDir.resolve("plugins").toAbsolutePath().toString());
}
// Use non-blocking randomness for acceptance tests
processBuilder
Expand Down Expand Up @@ -578,7 +572,7 @@ private void killBesuProcess(final String name) {

LOG.info("Killing {} process, pid {}", name, process.pid());

process.descendants().forEach(ProcessHandle::destroy);
process.destroy();
try {
process.waitFor(30, TimeUnit.SECONDS);
} catch (final InterruptedException e) {
Expand Down

0 comments on commit a370514

Please sign in to comment.