> On May 29, 2019, 6:02 p.m., Benjamin Mahler wrote: > > src/tests/master/mock_master_api_subscriber.cpp > > Lines 131-134 (patched) > > <https://reviews.apache.org/r/70671/diff/3/?file=2146934#file2146934line131> > > > > If possible, we prefer to use the "managed=true" approach to avoid > > self-wait deadlocks: > > > > ``` > > PID<MockMasterAPISubscriberProcess> process = > > spawn(new MockMasterAPISubscriberProcess(this), true); > > > > ... > > > > terminate(process); > > // no need to wait > > ``` > > > > However, it looks like that's not possible here since the process holds > > a back pointer to `this`? Perhaps it's worth noting that: > > > > ``` > > // Note that we must wait for the process to terminate before we leave > > // the destructor (and therefore cannot spawn the process with > > `managed=true`) > > // since the process may invoke the mock methods on this class. > > terminate(process.get()); > > wait(process.get()); > > ```
Hmm... That's a good question. I've recently (after refactoring a couple of existing master API tests) started to run into some deadlock on termination once in a while. Probably that's what's going on - I'll have a look. - Andrei ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/70671/#review215579 ----------------------------------------------------------- On May 29, 2019, 7:17 p.m., Andrei Sekretenko wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/70671/ > ----------------------------------------------------------- > > (Updated May 29, 2019, 7:17 p.m.) > > > Review request for mesos, Benno Evers, Benjamin Mahler, and Joseph Wu. > > > Bugs: MESOS-7258 > https://issues.apache.org/jira/browse/MESOS-7258 > > > Repository: mesos > > > Description > ------- > > This patch introduces a class with mock methods for subscribing to the > events of master's V1 streaming API and setting expectations for them. > > > Diffs > ----- > > src/Makefile.am 5f97523fbe2d80733fbdcc7706f2761f5a071f9f > src/tests/CMakeLists.txt e6b1d8a097246f0921467d7f778034d6754fcff6 > src/tests/master/mock_master_api_subscriber.hpp PRE-CREATION > src/tests/master/mock_master_api_subscriber.cpp PRE-CREATION > > > Diff: https://reviews.apache.org/r/70671/diff/4/ > > > Testing > ------- > > > Thanks, > > Andrei Sekretenko > >