> On March 14, 2018, 5:08 p.m., Chun-Hung Hsiao wrote: > > src/tests/slave_tests.cpp > > Line 4982 (original), 5022 (patched) > > <https://reviews.apache.org/r/65679/diff/4/?file=1968736#file1968736line5023> > > > > Is it guaranteed that this lambda will finish before > > `exitedExecutorMessage` is satisfied, so we can make sure that is function > > won't be called after the variables are destructed? > > > > If not, we probably should do the following instead: > > ``` > > Future<Nothing> unmocked___run = process::dispatch(slave.get()->pid, > > [&] { > > slave.get()->mock()->unmocked___run( > > ...); > > > > return Nothing(); > > }); > > ``` > > And do `AWAIT_READY(unmocked___run)` at the end of the test.
Currently, it is guaranteed, as send `exitedExecutorMessage` is the last statement of the function. But I should add your suggestion to be future proof. But this piece of code is gone after I updated the test to use the mock authorizer. Dropping the issue. > On March 14, 2018, 5:08 p.m., Chun-Hung Hsiao wrote: > > src/tests/slave_tests.cpp > > Lines 5179 (patched) > > <https://reviews.apache.org/r/65679/diff/4/?file=1968736#file1968736line5180> > > > > Is it guaranteed that this lambda will finish before `executorShutdown` > > is satisfied, so we can make sure that is function won't be called after > > the variables are destructed? > > > > If not, we need to do the same thing I suggested above. Currently, it is guaranteed, but let's add that to be future proof. - Meng ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/65679/#review199223 ----------------------------------------------------------- On March 16, 2018, 12:07 p.m., Meng Zhu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/65679/ > ----------------------------------------------------------- > > (Updated March 16, 2018, 12:07 p.m.) > > > Review request for mesos, Chun-Hung Hsiao and Greg Mann. > > > Bugs: MESOS-8611 > https://issues.apache.org/jira/browse/MESOS-8611 > > > Repository: mesos > > > Description > ------- > > Directly invoking unmock calls in the test process can potentially > cause races with the real mock slave process. It is more robust to > dispatch the unmock calls to the real mock slave process. > > Also added several mock expectations to avoid "uninteresting mock > call" test warnings. > > > Diffs > ----- > > src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 > > > Diff: https://reviews.apache.org/r/65679/diff/5/ > > > Testing > ------- > > `./bin/mesos-tests.sh --gtest_filter=*SlaveTest* --gtest_repeat=-1 > --gtest_break_on_failure` runs forever :) > > > Thanks, > > Meng Zhu > >
