> On Nov. 22, 2013, 2:58 a.m., Vinod Kone wrote:
> > src/tests/master_contender_detector_tests.cpp, line 433
> > <https://reviews.apache.org/r/15710/diff/2/?file=389605#file389605line433>
> >
> >     I don't know if I like this abstraction.
> >     
> >     How about using the AWAIT_ macro here? If that doesn't work with paused 
> > clocks we should fix that instead.
> 
> Ben Mahler wrote:
>     I'm also in favor of this, we would have to enhance or add to the AWAIT_ 
> macros for paused clocks to loop advancing the clock (possibly by a provided 
> duration) until the provided future transitions from pending.
>     Such a macro would indeed be better than LOOP_FOR and would be very 
> useful for tests that have a clock advance loop in paused tests.
>     
>     However, I'm interested in tests like isolator_test.cpp, which cannot use 
> an AWAIT_ style macro. It currently does exactly what LOOP_FOR is doing. It's 
> possible that this is the only example so perhaps we will want to avoid 
> adding this for a single test.
> 
> Jiang Yan Xu wrote:
>     I think fixing AWAIT_ solves another type of problems but in this case 
> (and in some in e.g. SlaveRecoveryTest) I can't use AWAIT_ either.
>     
>     You wait because a delay is involved and you want to advance the lock to 
> avoid really wait for that long.
>     You have to advance repeatedly (because you may have advanced the clock 
> before delay is called).
>     
>     Otherwise you have to first wait for delay to get called which 
> FUTURE_DISPATCH cannot accomplish.

Let's imagine you have something that handles a paused clock, like:

AWAIT_READY'(future, interval, limit)

{
  Duration total;
  if (Clock::paused()) {
    while (future.isPending() && total < limit) {
      Clock::advance(interval);
      Clock::settle();
      total += interval;
    }
  } else {
    ...
  }
}

Would this not help in this test?


- Ben


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


On Nov. 21, 2013, 11:18 p.m., Jiang Yan Xu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15710/
> -----------------------------------------------------------
> 
> (Updated Nov. 21, 2013, 11:18 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.
> 
> 
> Bugs: MESOS-823
>     https://issues.apache.org/jira/browse/MESOS-823
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   src/tests/master_contender_detector_tests.cpp 
> 5e4237454133edc155e74ffa04aec24ccd04c1b4 
>   src/tests/zookeeper_tests.cpp 0059438a26bfd03ee6da15029ca7a67674ea637e 
> 
> Diff: https://reviews.apache.org/r/15710/diff/
> 
> 
> Testing
> -------
> 
> make check Linux (100 iterations) and OSX.
> 
> 
> Thanks,
> 
> Jiang Yan Xu
> 
>

Reply via email to