You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Benjamin Mahler (JIRA)" <ji...@apache.org> on 2016/02/04 02:30:39 UTC
[jira] [Commented] (MESOS-4418) Create a test macro to advance
Clock for Future
[ https://issues.apache.org/jira/browse/MESOS-4418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15131514#comment-15131514 ]
Benjamin Mahler commented on MESOS-4418:
----------------------------------------
I don't know that we need a macro for this. Your example:
{code}
Clock::pause();
Clock::advance();
Clock::settle();
Clock::resume();
{code}
Is one particular scenario. I don't follow why you would settle after advancing here. We typically settle *before* we advance when we need to ensure an event is processed fully (e.g. a dispatch that invokes {{delay}} needs a {{settle}} before we {{advance}}). Or we settle if we have to perform a synchronous check that relies on events being processed fully after the advance.
It also seems a bit brittle to have an AWAIT macro that advances in a loop, since this means that the test code may experience 0 to N advances, rather than a single advance.
Any reason this is under the Test Speedup epic? Would be great if the description explained how this speeds up tests.
> Create a test macro to advance Clock for Future
> -----------------------------------------------
>
> Key: MESOS-4418
> URL: https://issues.apache.org/jira/browse/MESOS-4418
> Project: Mesos
> Issue Type: Improvement
> Reporter: haosdent
> Assignee: haosdent
> Labels: test
>
> For speed up test, we offer use
> {code}
> Clock::pause();
> Clock::advance();
> Clock::settle();
> Clock::resume();
> {code}
> when wait a {{Future}}
> I think it would be helpful if we could provide a macro contains these steps when wait a future done.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)