Gitlab service upgraded. Please report any problems to dl_gitadmin@cs.lth.se

Commit 8ffd68d9 authored by Noric Couderc's avatar Noric Couderc

Removed non-deterministic conditions from test

Running the benchmarks twice gives different results.
parent ff7d570b
......@@ -304,34 +304,6 @@ public class ApplicationTest {
List<TrainingSetValue> values =
r.createListApplicationsSpread(threshold, 100,new ListApplicationGenerator());
List<TrainingSetValue> newValues =
r.runBenchmarks(
values.stream().map(TrainingSetValue::getApplication)
.collect(Collectors.toList()));
// If we re-run the benchmarks, we should get similar values
for (int i = 0; i < values.size(); ++i) {
TrainingSetValue expected = values.get(i);
TrainingSetValue newValue = newValues.get(i);
Assert.assertEquals(
expected.getApplication().getIdentifier(),
newValue.getApplication().getIdentifier()
);
Assert.assertEquals(
expected.getRunningData().getMedian(),
newValue.getRunningData().getMedian(),
1e6 // 0.001 s difference max
);
Assert.assertEquals(
expected.getDataStructure(),
newValue.getDataStructure()
);
Assert.assertEquals(
expected.getBestDataStructure(),
newValue.getBestDataStructure()
);
}
Map<String, Long> histogram = values.stream().collect(
Collectors.groupingBy(TrainingSetValue::getBestDataStructure, Collectors.counting())
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment