Skip to content

Commit

Permalink
Add a sleep to get a more deterministic unit test result
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Jacobs committed Dec 29, 2015
1 parent 05e6e63 commit fbf3b4b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,12 @@ public void run() {
Thread t3 = new Thread(r3);

t2.start();
try {
Thread.sleep(100);
} catch (Throwable ex) {
fail(ex.getMessage());
}

t3.start();
try {
t2.join();
Expand All @@ -1005,6 +1011,9 @@ public void run() {
fail("We expected an exception on the 2nd get");
}

System.out.println("CMD1 : " + command1.getExecutionEvents());
System.out.println("CMD2 : " + command2.getExecutionEvents());
System.out.println("CMD3 : " + command3.getExecutionEvents());
assertCommandExecutionEvents(command1, HystrixEventType.EMIT, HystrixEventType.SUCCESS);
assertCommandExecutionEvents(command2, HystrixEventType.EMIT, HystrixEventType.SUCCESS);
assertCommandExecutionEvents(command3, HystrixEventType.SEMAPHORE_REJECTED, HystrixEventType.FALLBACK_MISSING);
Expand Down

0 comments on commit fbf3b4b

Please sign in to comment.