diff --git a/arithmetization/src/test/java/net/consensys/linea/replaytests/ReplayTestTools.java b/arithmetization/src/test/java/net/consensys/linea/replaytests/ReplayTestTools.java index 4ff200a8d6..bacaff3584 100644 --- a/arithmetization/src/test/java/net/consensys/linea/replaytests/ReplayTestTools.java +++ b/arithmetization/src/test/java/net/consensys/linea/replaytests/ReplayTestTools.java @@ -18,6 +18,7 @@ import static org.junit.jupiter.api.Assertions.fail; import java.io.BufferedReader; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -82,7 +83,7 @@ public static void replay(ChainConfig chain, String filename, boolean resultChec throw new RuntimeException(e); } ReplayExecutionEnvironment.builder() - .filename(filename) + .filename(new File(filename).getName()) .zkTracer(new ZkTracer(chain)) .txResultChecking(resultChecking) .build() diff --git a/gradle/tests.gradle b/gradle/tests.gradle index 81ded6d880..dd6c5e4eec 100644 --- a/gradle/tests.gradle +++ b/gradle/tests.gradle @@ -128,8 +128,8 @@ jacocoTestReport { } } -tasks.test.configure { - dependsOn("copyTracerPlugin", "downloadShoemiBesuPlugin") +def setupTestForBesuAndShomei(Test test) { + test.dependsOn("copyTracerPlugin", "downloadShoemiBesuPlugin") delete("${project.getLayout().getBuildDirectory().get()}/besu/traces") mkdir("${project.getLayout().getBuildDirectory().get()}/besu/traces") @@ -145,8 +145,13 @@ tasks.test.configure { ) ) - systemProperty("besu.traces.dir", System.getProperty("besu.traces.dir")) - systemProperty("besu.plugins.dir", System.getProperty("besu.plugins.dir")) + test.systemProperty("besu.traces.dir", System.getProperty("besu.traces.dir")) + test.systemProperty("besu.plugins.dir", System.getProperty("besu.plugins.dir")) +} + +tasks.test.configure { + + setupTestForBesuAndShomei (tasks.test) systemProperty("junit.jupiter.execution.parallel.enabled", true) systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent") @@ -158,6 +163,7 @@ tasks.test.configure { useJUnitPlatform { excludeTags("nightly") excludeTags("replay") + excludeTags("replay_with_besu") excludeTags("weekly") excludeTags("prc-calltests") } @@ -167,32 +173,15 @@ tasks.test.configure { tasks.register("besuNodeTests", Test) { forkEvery = 1 maxParallelForks = 3 + setupTestForBesuAndShomei(it) - dependsOn("copyTracerPlugin", "downloadShoemiBesuPlugin") - - delete("${project.getLayout().getBuildDirectory().get()}/besu/traces") - mkdir("${project.getLayout().getBuildDirectory().get()}/besu/traces") - mkdir("${project.getLayout().getBuildDirectory().get()}/besu/plugins") - System.setProperty("besu.plugins.dir", - System.getenv().getOrDefault("besu.plugins.dir", - "${project.getLayout().getBuildDirectory().get().toString()}/besu/plugins/" - ) - ) - System.setProperty("besu.traces.dir", - System.getenv().getOrDefault("besu.traces.dir", - "${project.getLayout().getBuildDirectory().get().toString()}/besu/traces/" - ) - ) - - - systemProperty("besu.traces.dir", System.getProperty("besu.traces.dir")) - systemProperty("besu.plugins.dir", System.getProperty("besu.plugins.dir")) environment("RUN_WITH_BESU_NODE", true) systemProperty("junit.jupiter.execution.parallel.enabled", false) useJUnitPlatform { excludeTags("nightly") excludeTags("replay") + excludeTags("replay_with_besu") excludeTags("weekly") excludeTags("prc-calltests") } @@ -229,36 +218,15 @@ tasks.register("fastReplayTests", Test) { finalizedBy(jacocoFastReplayTestsReport) } -tasks.register("besuNodeFastReplayTests", Test) { +tasks.register("besuNodeReplayTests", Test) { forkEvery = 1 maxParallelForks = 3 - - dependsOn("copyTracerPlugin", "downloadShoemiBesuPlugin") - - delete("${project.getLayout().getBuildDirectory().get()}/besu/traces") - mkdir("${project.getLayout().getBuildDirectory().get()}/besu/traces") - mkdir("${project.getLayout().getBuildDirectory().get()}/besu/plugins") - System.setProperty("besu.plugins.dir", - System.getenv().getOrDefault("besu.plugins.dir", - "${project.getLayout().getBuildDirectory().get().toString()}/besu/plugins/" - ) - ) - System.setProperty("besu.traces.dir", - System.getenv().getOrDefault("besu.traces.dir", - "${project.getLayout().getBuildDirectory().get().toString()}/besu/traces/" - ) - ) - - - systemProperty("besu.traces.dir", System.getProperty("besu.traces.dir")) - systemProperty("besu.plugins.dir", System.getProperty("besu.plugins.dir")) + setupTestForBesuAndShomei(it) environment("RUN_WITH_BESU_NODE", true) systemProperty("junit.jupiter.execution.parallel.enabled", false) useJUnitPlatform { - includeTags("replay") - excludeTags("nightly") - excludeTags("weekly") + includeTags("replay_with_besu") } finalizedBy(jacocoTestReport) } diff --git a/testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java b/testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java index 0d2ee0ee9d..6a8f24219c 100644 --- a/testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java +++ b/testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java @@ -95,7 +95,13 @@ public BesuExecutionTools( this.testName = tmpTestName.substring(0, Math.min(tmpTestName.length(), 200)); int besuPort = findFreePort(); int shomeiPort = findFreePort(); - this.httpClient = new OkHttpClient(); + this.httpClient = + new OkHttpClient.Builder() + .connectTimeout(10, java.util.concurrent.TimeUnit.MINUTES) + .writeTimeout(10, java.util.concurrent.TimeUnit.MINUTES) + .readTimeout(10, java.util.concurrent.TimeUnit.MINUTES) + .callTimeout(10, java.util.concurrent.TimeUnit.MINUTES) + .build(); this.chainConfig = chainConfig; GenesisConfigBuilder genesisConfigBuilder = new GenesisConfigBuilder(); genesisConfigBuilder.setChainId(chainConfig.id);