Commit b7495869 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added Thread.sleep to avoid issue with flacky test

parent 42401fc4
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -205,6 +205,12 @@ public class JobServiceTest {
        verify(moveService, timeout(1000).times(1)).processMoveJob(any(), any());
        verify(moveService, timeout(1000).times(1)).processMoveJob(any(), any());


        verify(jobDAO, timeout(1000).times(3)).updateJob(any(), any());
        verify(jobDAO, timeout(1000).times(3)).updateJob(any(), any());

        try {
            Thread.sleep(500);
        } catch (InterruptedException ex) {
        }

        assertEquals(ExecutionPhase.EXECUTING, phases.get(0));
        assertEquals(ExecutionPhase.EXECUTING, phases.get(0));
        assertEquals(ExecutionPhase.EXECUTING, phases.get(1));
        assertEquals(ExecutionPhase.EXECUTING, phases.get(1));
        assertEquals(ExecutionPhase.COMPLETED, phases.get(2));
        assertEquals(ExecutionPhase.COMPLETED, phases.get(2));