----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31114/#review72741 -----------------------------------------------------------
src/tests/master_tests.cpp <https://reviews.apache.org/r/31114/#comment118797> Hmm. I don't understand the fix here. First off, any expectations should be set *before* the corresponding actions (e.g., StartSlave). I think you just want to move the AWAIT_READY(slaveRegisteredMessage) before the second StartSlave()? IOW, ``` // Start the first slave and wait for it to be registered. Future<SlaveRegisteredMessage> slave1RegisteredMessage = FUTURE_PROTOBUF(SlaveRegisteredMessage(), master.get(), _); StartSlave(); AWAIT_READY(slave1RegisteredMessage); // Start the second slave and wait for it to be registered. Future<SlaveRegisteredMessage> slave2RegisteredMessage = FUTURE_PROTOBUF(SlaveRegisteredMessage(), master.get(), _); StartSlave(); AWAIT_READY(slave2RegisteredMessage); ``` - Vinod Kone On Feb. 17, 2015, 4:36 p.m., Alexander Rojas wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/31114/ > ----------------------------------------------------------- > > (Updated Feb. 17, 2015, 4:36 p.m.) > > > Review request for mesos, Ben Mahler, Till Toenshoff, and Vinod Kone. > > > Bugs: MESOS-2355 > https://issues.apache.org/jira/browse/MESOS-2355 > > > Repository: mesos-incubating > > > Description > ------- > > Sets the "to" end to all calls to `FUTURE_PROTOBUF` within the > MasterTest.SlavesEndpointTwoSlaves. > > Failing to do that causes the test to fail on very rare ocasions, due to the > first slave registering twice to the server (this is normal behavior > according to > [slave.cpp](https://github.com/apache/mesos/blob/master/src/slave/slave.cpp#L1087) > and > [master.cpp](https://github.com/apache/mesos/blob/master/src/master/master.cpp#L2912). > > It those ocasions, where the first slave registers twice, the master's sends > a reponse to both registration requests before the second slave's turn, thus > setting the future which was expecting data for the second slave with > incorrect data. > > > Diffs > ----- > > src/tests/master_tests.cpp 18eabd4 > > Diff: https://reviews.apache.org/r/31114/diff/ > > > Testing > ------- > > /bin/mesos-tests.sh --gtest_filter="MasterTest.SlavesEndpoint*" > --gtest_repeat=1000 --gtest_break_on_failure > > > Thanks, > > Alexander Rojas > >
