File tree 1 file changed +3
-1
lines changed
hystrix-core/src/test/java/com/netflix/hystrix 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2440,6 +2440,7 @@ public void testSynchronousExecutionTimeoutValueViaExecute() {
2440
2440
2441
2441
System .out .println (">>>>> Begin: " + System .currentTimeMillis ());
2442
2442
2443
+ final AtomicBoolean startedExecution = new AtomicBoolean ();
2443
2444
HystrixObservableCommand <String > command = new HystrixObservableCommand <String >(properties ) {
2444
2445
@ Override
2445
2446
protected Observable <String > construct () {
@@ -2449,6 +2450,7 @@ protected Observable<String> construct() {
2449
2450
@ Override
2450
2451
public void call (Subscriber <? super String > t1 ) {
2451
2452
try {
2453
+ startedExecution .set (true );
2452
2454
Thread .sleep (2000 );
2453
2455
} catch (InterruptedException e ) {
2454
2456
e .printStackTrace ();
@@ -2477,7 +2479,7 @@ protected Observable<String> resumeWithFallback() {
2477
2479
assertEquals ("expected fallback value" , "timed-out" , value );
2478
2480
2479
2481
// Thread isolated
2480
- assertTrue (command .isExecutedInThread ());
2482
+ assertTrue (! startedExecution . get () || command .isExecutedInThread ());
2481
2483
assertNotNull (command .getExecutionException ());
2482
2484
2483
2485
assertEquals (0 , command .metrics .getCurrentConcurrentExecutionCount ());
You can’t perform that action at this time.
0 commit comments