Skip to content

Commit

Permalink
add parallelism to speed up a bit...
Browse files Browse the repository at this point in the history
add intermediary results back.
  • Loading branch information
FlorianHuc committed Oct 14, 2024
1 parent 4582f20 commit e4ea778
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reference-blockchain-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
timeout-minutes: 180
continue-on-error: true
env:
REFERENCE_TESTS_PARALLELISM: 5
REFERENCE_TESTS_PARALLELISM: 8
JAVA_OPTS: -Dorg.gradle.daemon=false -Xmx122G
CORSET_FLAGS: disable
GOCORSET_FLAGS: -wd --ansi-escapes=false --report --air
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package net.consensys.linea;

import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down Expand Up @@ -186,12 +187,15 @@ public static void writeToJsonFile(String name) {
private static CompletableFuture<Void> writeToJsonFileInternal(String name) {
String fileDirectory = setFileDirectory();
log.info("writing results summary to {}", fileDirectory + "/" + name);
// String jsonString = jsonConverter.toJson(testOutcomes);
// log.info(jsonString);
try {
Files.createDirectories(Path.of(fileDirectory));
} catch (IOException e) {
log.error("Error - Failed to create test directory output: %s".formatted(e.getMessage()));
throw new RuntimeException(e);
}
return CompletableFuture.runAsync(
() -> {
try (FileWriter file = new FileWriter(fileDirectory + name)) {
Files.createDirectories(Path.of(fileDirectory));
objectMapper.writeValue(file, testOutcomes);
} catch (Exception e) {
log.error("Error - Failed to write test output: %s".formatted(e.getMessage()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public void testFailed(ExtensionContext context, Throwable cause) {
ReferenceTestOutcomeRecorderTool.mapAndStoreTestResult(testName, FAILED, logEventMessages);
log.info("Failure added for {}", testName);
int count = counter.incrementAndGet();
// if(count%1000 == 0){
// log.info("intermediary persistence after {} failures", count);
// writeToJsonFile(count + "_" + JSON_OUTPUT_FILENAME);
// }
if(count%1000 == 0){
log.info("intermediary persistence after {} failures", count);
writeToJsonFile(count + "_" + JSON_OUTPUT_FILENAME);
}
}

private static Map<String, Set<String>> getLogEventMessages(Throwable cause) {
Expand Down

0 comments on commit e4ea778

Please sign in to comment.