You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Kevin Klues <kl...@gmail.com> on 2016/01/28 23:16:42 UTC

Review Request 42921: Fixed flaky MaxCompletedTasksPerFrameworkFlag test.

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

Review request for mesos, Anand Mazumdar and Ben Mahler.


Bugs: MESOS-4518
    https://issues.apache.org/jira/browse/MESOS-4518


Repository: mesos


Description
-------

Previously, this test was calling EXPECT_CALL() on
SchedulerDriver.resourceOffers() after the scheduler driver itself had
already been started. This resulted in flaky test results when offers
came in between schedDriver.start() and the EXPECT_CALL().

This commit fixes this test by moving the EXPECT_CALL() above the
schedDriver.start() call. However, because of the nature of this test,
this introduced a few complexities related to processing the incoming offers
in a loop later on. To allow this, we had to introduce a custom gmock
ACTION to enqueue offers in a process::Queue for later processing. In
the future we shoudl consider generalizing this custom ACTION or at
least moving it into src/tests/mesos.hpp for more general use.


Diffs
-----

  src/tests/master_tests.cpp ce6ce25a03cdb0883612fe40b20996ec2e50de40 

Diff: https://reviews.apache.org/r/42921/diff/


Testing
-------

Tested locally on my mac, as well as with running support/docker_build.sh on a linux machine.


Thanks,

Kevin Klues


Re: Review Request 42921: Fixed flaky MaxCompletedTasksPerFrameworkFlag test.

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42921/#review117018
-----------------------------------------------------------


Ship it!




Ship It!

- Ben Mahler


On Jan. 28, 2016, 10:56 p.m., Kevin Klues wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42921/
> -----------------------------------------------------------
> 
> (Updated Jan. 28, 2016, 10:56 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Ben Mahler.
> 
> 
> Bugs: MESOS-4518
>     https://issues.apache.org/jira/browse/MESOS-4518
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Previously, this test was calling EXPECT_CALL() on
> SchedulerDriver.resourceOffers() after the scheduler driver itself had
> already been started. This resulted in flaky test results when offers
> came in between schedDriver.start() and the EXPECT_CALL().
> 
> This commit fixes this test by moving the EXPECT_CALL() above the
> schedDriver.start() call. However, because of the nature of this test,
> this introduced a few complexities related to processing the incoming offers
> in a loop later on. To allow this, we had to introduce a custom gmock
> ACTION to enqueue offers in a process::Queue for later processing. This
> ACTION is generally useful and has been placed in src/tests/mesos.hpp.
> 
> 
> Diffs
> -----
> 
>   src/tests/master_tests.cpp ce6ce25a03cdb0883612fe40b20996ec2e50de40 
>   src/tests/mesos.hpp 845b637c765b5b97568e9b3797b53814d2ab7782 
> 
> Diff: https://reviews.apache.org/r/42921/diff/
> 
> 
> Testing
> -------
> 
> Tested locally on my mac, as well as with running support/docker_build.sh on a linux machine.
> 
> 
> Thanks,
> 
> Kevin Klues
> 
>


Re: Review Request 42921: Fixed flaky MaxCompletedTasksPerFrameworkFlag test.

Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42921/#review116837
-----------------------------------------------------------



Patch looks great!

Reviews applied: [42921]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 28, 2016, 10:56 p.m., Kevin Klues wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42921/
> -----------------------------------------------------------
> 
> (Updated Jan. 28, 2016, 10:56 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Ben Mahler.
> 
> 
> Bugs: MESOS-4518
>     https://issues.apache.org/jira/browse/MESOS-4518
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Previously, this test was calling EXPECT_CALL() on
> SchedulerDriver.resourceOffers() after the scheduler driver itself had
> already been started. This resulted in flaky test results when offers
> came in between schedDriver.start() and the EXPECT_CALL().
> 
> This commit fixes this test by moving the EXPECT_CALL() above the
> schedDriver.start() call. However, because of the nature of this test,
> this introduced a few complexities related to processing the incoming offers
> in a loop later on. To allow this, we had to introduce a custom gmock
> ACTION to enqueue offers in a process::Queue for later processing. This
> ACTION is generally useful and has been placed in src/tests/mesos.hpp.
> 
> 
> Diffs
> -----
> 
>   src/tests/master_tests.cpp ce6ce25a03cdb0883612fe40b20996ec2e50de40 
>   src/tests/mesos.hpp 845b637c765b5b97568e9b3797b53814d2ab7782 
> 
> Diff: https://reviews.apache.org/r/42921/diff/
> 
> 
> Testing
> -------
> 
> Tested locally on my mac, as well as with running support/docker_build.sh on a linux machine.
> 
> 
> Thanks,
> 
> Kevin Klues
> 
>


Re: Review Request 42921: Fixed flaky MaxCompletedTasksPerFrameworkFlag test.

Posted by Kevin Klues <kl...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42921/
-----------------------------------------------------------

(Updated Jan. 28, 2016, 10:56 p.m.)


Review request for mesos, Anand Mazumdar and Ben Mahler.


Changes
-------

Updated based on comments, including a move of EnqueueOffers() into src/tests/mesos.hpp


Bugs: MESOS-4518
    https://issues.apache.org/jira/browse/MESOS-4518


Repository: mesos


Description (updated)
-------

Previously, this test was calling EXPECT_CALL() on
SchedulerDriver.resourceOffers() after the scheduler driver itself had
already been started. This resulted in flaky test results when offers
came in between schedDriver.start() and the EXPECT_CALL().

This commit fixes this test by moving the EXPECT_CALL() above the
schedDriver.start() call. However, because of the nature of this test,
this introduced a few complexities related to processing the incoming offers
in a loop later on. To allow this, we had to introduce a custom gmock
ACTION to enqueue offers in a process::Queue for later processing. This
ACTION is generally useful and has been placed in src/tests/mesos.hpp.


Diffs (updated)
-----

  src/tests/master_tests.cpp ce6ce25a03cdb0883612fe40b20996ec2e50de40 
  src/tests/mesos.hpp 845b637c765b5b97568e9b3797b53814d2ab7782 

Diff: https://reviews.apache.org/r/42921/diff/


Testing
-------

Tested locally on my mac, as well as with running support/docker_build.sh on a linux machine.


Thanks,

Kevin Klues


Re: Review Request 42921: Fixed flaky MaxCompletedTasksPerFrameworkFlag test.

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42921/#review116829
-----------------------------------------------------------



Looks great, just some minor comments below.


src/tests/master_tests.cpp (line 3993)
<https://reviews.apache.org/r/42921/#comment177933>

    In general we'll add a newline between the end of your comment and the start of the TODO:
    
    ```
    // Action to enqueue all received offers from SchedulerDriver.resourceOffers()
    // into a libprocess queue. Currently, this is only used in the
    // MaxCompletedTasksPerFrameworkFlag test below.
    //
    // TODO(klueska): Move this into src/tests/mesos.hpp if we decide it is more
    // generally useful.
    ```
    
    Just to make it a bit easier to read when there are multiple TODOs, NOTEs, etc. Or it becomes sometimes hard to tell where a TODO ends and a comment starts again (e.g. if the TODO line ends with a period, is the next line part of the TODO or the comment?)
    
    But mind just moving this to mesos.hpp? Seems generally useful (at some point we should have a gmock.hpp or gmock/actions.hpp header).



src/tests/master_tests.cpp (line 3998)
<https://reviews.apache.org/r/42921/#comment177934>

    Sometimes we'll use single letter names, but it's more typical that we don't abbreviate here:
    
    s/o/offer/



src/tests/master_tests.cpp (line 4038)
<https://reviews.apache.org/r/42921/#comment177935>

    Usually the type is omitted from the name, e.g. schedRegistered instead of schedRegisteredFuture.
    
    So the following would be more consistent with our naming style:
    
    ```
    s/offersQueue/offers/
    ```


- Ben Mahler


On Jan. 28, 2016, 10:16 p.m., Kevin Klues wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42921/
> -----------------------------------------------------------
> 
> (Updated Jan. 28, 2016, 10:16 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Ben Mahler.
> 
> 
> Bugs: MESOS-4518
>     https://issues.apache.org/jira/browse/MESOS-4518
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Previously, this test was calling EXPECT_CALL() on
> SchedulerDriver.resourceOffers() after the scheduler driver itself had
> already been started. This resulted in flaky test results when offers
> came in between schedDriver.start() and the EXPECT_CALL().
> 
> This commit fixes this test by moving the EXPECT_CALL() above the
> schedDriver.start() call. However, because of the nature of this test,
> this introduced a few complexities related to processing the incoming offers
> in a loop later on. To allow this, we had to introduce a custom gmock
> ACTION to enqueue offers in a process::Queue for later processing. In
> the future we shoudl consider generalizing this custom ACTION or at
> least moving it into src/tests/mesos.hpp for more general use.
> 
> 
> Diffs
> -----
> 
>   src/tests/master_tests.cpp ce6ce25a03cdb0883612fe40b20996ec2e50de40 
> 
> Diff: https://reviews.apache.org/r/42921/diff/
> 
> 
> Testing
> -------
> 
> Tested locally on my mac, as well as with running support/docker_build.sh on a linux machine.
> 
> 
> Thanks,
> 
> Kevin Klues
> 
>