From 7726d47795d83fb1a3a6094b653d173158f38a48 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 24 Mar 2021 17:31:16 +0300 Subject: [PATCH] C: don't run compiled tests simultaneously --- .../src/main/java/org/teavm/junit/CRunStrategy.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/junit/src/main/java/org/teavm/junit/CRunStrategy.java b/tools/junit/src/main/java/org/teavm/junit/CRunStrategy.java index 89b583893..dd2a3ab76 100644 --- a/tools/junit/src/main/java/org/teavm/junit/CRunStrategy.java +++ b/tools/junit/src/main/java/org/teavm/junit/CRunStrategy.java @@ -67,12 +67,14 @@ class CRunStrategy implements TestRunStrategy { List runtimeOutput = new ArrayList<>(); List stdout = new ArrayList<>(); outputFile.setExecutable(true); - List runCommand = new ArrayList<>(); - runCommand.add(outputFile.getPath()); - if (run.getArgument() != null) { - runCommand.add(run.getArgument()); + synchronized (this) { + List runCommand = new ArrayList<>(); + runCommand.add(outputFile.getPath()); + if (run.getArgument() != null) { + runCommand.add(run.getArgument()); + } + runProcess(new ProcessBuilder(runCommand.toArray(new String[0])).start(), runtimeOutput, stdout); } - runProcess(new ProcessBuilder(runCommand.toArray(new String[0])).start(), runtimeOutput, stdout); if (!stdout.isEmpty() && stdout.get(stdout.size() - 1).equals("SUCCESS")) { writeLines(runtimeOutput); run.getCallback().complete();