Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2571

Race condition in the school timetabling quickstart

XMLWordPrintable

    • 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

        1. log
          0.9 kB
          Radovan Synek

              rsynek@redhat.com Radovan Synek (Inactive)
              rsynek@redhat.com Radovan Synek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: