> On Nov. 13, 2017, 1:43 p.m., Bill Farner wrote:
> > src/test/java/org/apache/aurora/scheduler/mesos/MesosCallbackHandlerTest.java
> > Line 335 (original), 337 (patched)
> > <https://reviews.apache.org/r/63763/diff/1/?file=1890883#file1890883line339>
> >
> >     Can we get away with `MoreExecutors.directExecutor()` instead?
> 
> Jordan Ly wrote:
>     I don't believe so. This test depends on a delay between `execute(...)` 
> and the runnable being executed. Is there some way to control when 
> `directExecutor()` executes actions (ie. can it execute actions not 
> immediately)?

How about use `directExecutor()` and just move this line
```java
handler.handleRescind(OFFER_ID);
```

before this one
```java
handler.handleOffers(ImmutableList.of(HOST_OFFER.getOffer()));
```

The behavior is ~identical, and as a result the test body reads in a way that 
matches the test name.

I'd also advocate for the removal of the strict mock.


- Bill


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/63763/#review190886
-----------------------------------------------------------


On Nov. 13, 2017, 11:32 a.m., Jordan Ly wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63763/
> -----------------------------------------------------------
> 
> (Updated Nov. 13, 2017, 11:32 a.m.)
> 
> 
> Review request for Aurora and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> In the same vein as: https://reviews.apache.org/r/63760/
> 
> Fix a flaky test that uses `Thread.sleep` by injecting a fake Executor.
> 
> 
> Diffs
> -----
> 
>   
> src/test/java/org/apache/aurora/scheduler/mesos/MesosCallbackHandlerTest.java 
> 8f8b86dfb5d53439671ca59e6c42245b31fc6136 
> 
> 
> Diff: https://reviews.apache.org/r/63763/diff/1/
> 
> 
> Testing
> -------
> 
> `./gradlew test`
> 
> 
> Thanks,
> 
> Jordan Ly
> 
>

Reply via email to