mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiang Yan Xu <...@jxu.me>
Subject Re: Review Request 63830: Fixed 'NoOffersWithAllRolesSuppressed' test.
Date Fri, 01 Dec 2017 22:53:18 GMT


> On Nov. 21, 2017, 9:53 a.m., Alexander Rukletsov wrote:
> > src/tests/scheduler_tests.cpp
> > Lines 1515-1516 (original), 1534-1535 (patched)
> > <https://reviews.apache.org/r/63830/diff/1/?file=1892884#file1892884line1542>
> >
> >     `.WillRepeatedly(Return());`
> 
> Jiang Yan Xu wrote:
>     There's only one agent with no tasks launched so I don't expect additional offers?
> 
> Alexander Rukletsov wrote:
>     I see it in a different way. The default behaviour is ignore subsequent offers and
only if you need to verify that in some particular case no more offers will be made, you should
omit `.WillRepeatedly(Return());`. In this case what you want to check is that "scheduler
starts getting offers" saying nothing about its quantity or periodicity.

Oh ok, but if I am intentionally testing no more offers will be made I'll probably need to
settle the clock etc to prevent race conditions (and comment as such).

Are you suggesting that when writing tests we should by default always add `.WillRepeatedly(Return());`?
I am not sure if I have seen this being adopted and it seems to result in necessary code.

So my approach has been that, if the test is pretty deterministic, write the test asserting
the precise case. If there are certain unpredicable race condidtions (maybe not worth preventing
because you don't care), then use these `WillRepeatedly // Ignore because don't care` calls.

Reasonable? :)


- Jiang Yan


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


On Nov. 21, 2017, 9:46 a.m., Jiang Yan Xu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63830/
> -----------------------------------------------------------
> 
> (Updated Nov. 21, 2017, 9:46 a.m.)
> 
> 
> Review request for mesos and Alexander Rukletsov.
> 
> 
> Bugs: MESOS-7996
>     https://issues.apache.org/jira/browse/MESOS-7996
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The previous iteration of the test failed to reveal the bug in MESOS-8200 due to a race
condition.
> 
> 
> Diffs
> -----
> 
>   src/tests/scheduler_tests.cpp 45fc9c0cfccdb22c2e3e8d5de30c04575814a0e9 
> 
> 
> Diff: https://reviews.apache.org/r/63830/diff/1/
> 
> 
> Testing
> -------
> 
> As expected, this test would reliably fail without /r/63741/ with the following
> 
> ```
> I1115 07:48:28.536093 3117031 scheduler.cpp:741] Enqueuing event SUBSCRIBED received
from http://17.121.128.13:38423/master/api/v1/scheduler
> I1115 07:48:28.536224 3117031 scheduler.cpp:741] Enqueuing event HEARTBEAT received from
http://17.121.128.13:38423/master/api/v1/scheduler
> I1115 07:48:28.536244 3117029 master.cpp:8115] Sending 1 offers to framework 560bd0e1-8ab7-4e7e-be7a-54cb5f399531-0000
(default)
> I1115 07:48:28.536650 3117029 scheduler.cpp:741] Enqueuing event OFFERS received from
http://17.121.128.13:38423/master/api/v1/scheduler
> ../../src/tests/scheduler_tests.cpp:1497: Failure
> Mock function called more times than expected - returning directly.
>     Function call: offers(0x7fffabd197a0, @0x7f7d8c005460 48-byte object <50-98 0B-B0
7D-7F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 01-00
00-00 04-00 00-00 A0-54 00-8C 7D-7F 00-00>)
>          Expected: to be never called
>            Actual: called once - over-saturated and active
> ```
> 
> The test passes with /r/63741/.
> 
> 
> Thanks,
> 
> Jiang Yan Xu
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message