| | |
| | | while (TaskState.isPending(task.getTaskState())) |
| | | { |
| | | Thread.sleep(10); |
| | | if (System.currentTimeMillis() > (startTime + 300000L)) |
| | | if (System.currentTimeMillis() > startTime + 300000L) |
| | | { |
| | | throw new AssertionError("Waited too long for the task to start"); |
| | | } |
| | |
| | | while (TaskState.isPending(task.getTaskState())) |
| | | { |
| | | Thread.sleep(10); |
| | | if (System.currentTimeMillis() > (startTime + 300000L)) |
| | | if (System.currentTimeMillis() > startTime + 300000L) |
| | | { |
| | | throw new AssertionError("Waited too long for the task to start"); |
| | | } |
| | |
| | | // We may have to wait for the task to register as done, but it should |
| | | // definitely be done before it would have stopped normally. |
| | | task = TasksTestCase.getCompletedTask(DN.valueOf(taskDN)); |
| | | assertTrue((System.currentTimeMillis() - startTime) < 300000L); |
| | | assertTrue(System.currentTimeMillis() - startTime < 300000L); |
| | | assertTrue(TaskState.isDone(task.getTaskState())); |
| | | |
| | | |