bptlab / scylla

Extensible BPMN process simulator
MIT License
19 stars 9 forks source link

Fix flaky tests #58

Closed LeonBein closed 11 months ago

LeonBein commented 11 months ago

Some tests have shown to be flaky (i.e. failing non-deterministically). The following were identified:

LeonBein commented 11 months ago

[confirmed] Actual error might be in Statisticslogger:103 because detailed error message states java.lang.NullPointerException: Cannot invoke "de.hpi.bpt.scylla.simulation.ResourceObject.getTimetable()" because the return value of "java.util.Map.get(Object)" is null and this is the only place getTimetable is run on a result of Map.get

LeonBein commented 11 months ago

Potential real root cause

Exception in thread "proceed" java.lang.NullPointerException: Cannot invoke "de.hpi.bpt.scylla.simulation.ResourceObjectTuple.getResourceObjects()" because the return value of "java.util.Map.get(Object)" is null at de.hpi.bpt.scylla.simulation.event.TaskTerminateEvent.addToLog(TaskTerminateEvent.java:128) at de.hpi.bpt.scylla.simulation.event.TaskEvent.eventRoutine(TaskEvent.java:30) at de.hpi.bpt.scylla.simulation.event.TaskTerminateEvent.eventRoutine(TaskTerminateEvent.java:40) at de.hpi.bpt.scylla.simulation.event.TaskTerminateEvent.eventRoutine(TaskTerminateEvent.java:31) at desmoj.core.simulator.Scheduler.processNextEventNote(Unknown Source) at desmoj.core.simulator.Experiment.doProceed(Unknown Source) at desmoj.core.simulator.Experiment.access$000(Unknown Source) at desmoj.core.simulator.Experiment$2.run(Unknown Source) at co.paralleluniverse.strands.Strand$SuspendableRunnableRunnable.run(Strand.java:825) at java.base/java.lang.Thread.run(Thread.java:1623)

LeonBein commented 11 months ago

Analyzing the trace shows that in some cases, a batch cluster is enabled twice. Because there are multiple batch cluster start events created. Because some cluster enable events trigger twice.