Skip to content

Commit e48055a

Browse files
committed
Don't fail prematurely
1 parent 5f950d2 commit e48055a

File tree

1 file changed

+3
-10
lines changed
  • src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector

1 file changed

+3
-10
lines changed

src/main/java/ai/timefold/solver/benchmarks/micro/scoredirector/Main.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@
3333

3434
import java.io.IOException;
3535
import java.io.InputStream;
36-
import java.util.concurrent.atomic.AtomicBoolean;
3736

3837
import ai.timefold.solver.benchmarks.micro.common.AbstractMain;
3938

40-
import org.openjdk.jmh.results.Result;
4139
import org.openjdk.jmh.runner.Runner;
4240
import org.openjdk.jmh.runner.RunnerException;
4341
import org.openjdk.jmh.runner.options.ChainedOptionsBuilder;
@@ -78,26 +76,21 @@ public static void main(String[] args) throws RunnerException, IOException {
7876
var relativeScoreErrorThreshold = configuration.getRelativeScoreErrorThreshold();
7977
var thresholdForPrint = ((int) Math.round(relativeScoreErrorThreshold * 10_000)) / 100.0D;
8078
runResults.forEach(result -> {
81-
Result<?> primaryResult = result.getPrimaryResult();
79+
var primaryResult = result.getPrimaryResult();
8280
var score = primaryResult.getScore();
8381
var scoreError = primaryResult.getScoreError();
8482
var relativeScoreError = scoreError / score;
8583

8684
var benchParams = result.getParams();
8785
var benchmarkName = benchParams.getBenchmark() + " " + benchParams.getParam("csExample");
8886
var relativeScoreErrorForPrint = ((int) Math.round(relativeScoreError * 10_000)) / 100.0D;
89-
var wasSuccess = new AtomicBoolean(true);
9087
if (relativeScoreError > relativeScoreErrorThreshold) {
91-
LOGGER.error("Score error for '{}' is too high: ± {} % (threshold: ± {} %).", benchmarkName,
88+
LOGGER.warn("Score error for '{}' is too high: ± {} % (threshold: ± {} %).", benchmarkName,
9289
relativeScoreErrorForPrint, thresholdForPrint);
93-
wasSuccess.set(false);
9490
} else if (relativeScoreError > (relativeScoreErrorThreshold * 0.9)) {
95-
LOGGER.warn("Score error for '{}' approaching threshold: ± {} % (threshold: ± {} %).", benchmarkName,
91+
LOGGER.info("Score error for '{}' approaching threshold: ± {} % (threshold: ± {} %).", benchmarkName,
9692
relativeScoreErrorForPrint, thresholdForPrint);
9793
}
98-
if (!wasSuccess.get()) {
99-
System.exit(1);
100-
}
10194
});
10295
}
10396

0 commit comments

Comments
 (0)