Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-2584

Eliminate Thread.sleep() calls in TestMemoryLocks

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.0
    • Component/s: None
    • Labels:
      None

      Description

      There are a lot of Thread.sleep() calls in TestMemoryLocks.

      For example:

              new Thread(l1).start();
              Thread.sleep(500);
              new Thread(l2).start();
              Thread.sleep(500);
      

      This solution is very fragile. On a slower build machine, Thread2 might actually start earlier than Thread1, causing test failure.

      Eliminate sleeps and use a more stable approach for start/stop coordination (possibly CountDownLatches).

        Attachments

        1. OOZIE-2584-002.patch
          12 kB
          Peter Bacsko
        2. OOZIE-2584-001.patch
          11 kB
          Peter Bacsko

          Activity

            People

            • Assignee:
              pbacsko Peter Bacsko
              Reporter:
              pbacsko Peter Bacsko
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: