Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-21939

Create reliable unit test work

    XMLWordPrintable

    Details

    • Tags:
    • Story Points:
      8

      Description

      WorkManager is unit tested using SleepWork which is a work that is supposed to run for a determined amount of time using Thread.sleep().
      This is not optimal because:

      • unit tests are slow because of the sleep usage
      • it is not reliable and generates random failure, the reason is that job executions can be delayed because of external constraint (CI slaves overwhelm, redis warmup, embedded redis warmup for Nuxeo < 9.1), this is often fixed by increasing the job duration

      So it might be better to use a work implementation that uses lock driven by the test.
      Note that the end of work don't match exactly the end of work as viewed by the WorkManager, so the problem is not as trivial as adding a shared lock.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bdelbosc Benoit Delbosc
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: