-
Bug
-
Resolution: Done
-
Optional
-
7.59.0.Final
-
None
-
NEW
-
NEW
A school timetabling quickstart test failed on one of the 7.x release branches due to a race condition that might affect also the latest versions.
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
at com.example.schooltimetabling.solver.TimeTableControllerTest.solveDemoDataUntilFeasible(TimeTableControllerTest.java:57)
Race condition:
1) read the solver state, which is NOT_SOLVING
2) find the timetable in the DB
https://github.com/kiegroup/optaplanner/blob/7.x/optaplanner-quickstarts/spring-boot-school-timetabling/src/main/java/com/example/schooltimetabling/solver/TimeTableController.java#L47-L48
3) the last best solution has not been written to a DB by the solver thread yet
https://github.com/kiegroup/optaplanner/blob/7.x/optaplanner-quickstarts/spring-boot-school-timetabling/src/main/java/com/example/schooltimetabling/solver/TimeTableController.java#L58
4) update the solution to include the solver state and return it to the client
5) the test fails as it expects the solution to be feasible after solving ended