Revert 7e46889 which slowed down ATs (#6948)

This reverts commit 7e46889817.

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
pull/6959/head
Simon Dudley 7 months ago committed by GitHub
parent da03bf2417
commit b1d8554e23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/AcceptanceTestBase.java
  2. 15
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java
  3. 18
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java

@ -56,12 +56,15 @@ import java.math.BigInteger;
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 {
@ -128,7 +131,7 @@ public class AcceptanceTestBase {
exitedSuccessfully = new ExitedWithCode(0);
}
@AfterEach
@After
public void tearDownAcceptanceTestBase() {
reportMemory();
cluster.close();

@ -789,21 +789,6 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
nodeRequests.shutdown();
nodeRequests = null;
}
deleteRuntimeFiles();
}
private void deleteRuntimeFiles() {
try {
Files.deleteIfExists(homeDirectory.resolve("besu.networks"));
} catch (IOException e) {
LOG.error("Failed to clean up besu.networks file in {}", homeDirectory, e);
}
try {
Files.deleteIfExists(homeDirectory.resolve("besu.ports"));
} catch (IOException e) {
LOG.error("Failed to clean up besu.ports file in {}", homeDirectory, e);
}
}
@Override

@ -52,7 +52,6 @@ import java.util.concurrent.Executors;
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;
@ -78,15 +77,8 @@ public class ProcessBesuNodeRunner implements BesuNodeRunner {
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());
@ -430,13 +422,15 @@ public class ProcessBesuNodeRunner implements BesuNodeRunner {
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
@ -578,7 +572,7 @@ public class ProcessBesuNodeRunner implements BesuNodeRunner {
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) {

Loading…
Cancel
Save