mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Mann <>
Subject Re: Review Request 44989: Fixed a race in the resource offers tests.
Date Fri, 18 Mar 2016 18:55:37 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated March 18, 2016, 6:55 p.m.)

Review request for mesos, Adam B and Joerg Schad.


Addressed comment.

Bugs: MESOS-4849

Repository: mesos


Fixed a race in the resource offers tests.

Adding HTTP credentials to `StartSlave` in 'src/tests/mesos.cpp' has exposed a race condition
in ResourceOffersTest.ResourceOfferWithMultipleSlaves. The test quickly runs `StartSlave`
10 times to create 10 agents. Under the covers, `StartSlave` writes data to disk, and it seems
that with the additional data being written to disk for HTTP credentials, the filesystem operations
for one `StartSlave` call were not completing before the next call.

By settling the clock in between each invocation of `StartSlave`, this patch fixes the race.
The test is slower, but it is now reliable. Running the test 3 times, the old implementation
gives an average runtime of 265ms, while the new one runs in an average of 359ms.

Diffs (updated)

  src/tests/resource_offers_tests.cpp 1cf292ee7931207596f8f06677386bef5965ef15 



`GTEST_FILTER="ResourceOffersTest.ResourceOfferWithMultipleSlaves" bin/ --gtest_repeat=1000
--gtest_break_on_failure=1` was used to test on both OSX and Ubuntu 14.04.


Greg Mann

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