> On Jan. 13, 2016, 9:02 p.m., Benjamin Hindman wrote: > > src/tests/container_logger_tests.cpp, lines 153-154 > > <https://reviews.apache.org/r/41962/diff/3/?file=1194957#file1194957line153> > > > > Ugh, using something we passed in as `Owned` above? Have we still not > > cleaned up this pattern in the code base?
We have not (in tests). Is it really bad? Presumably, mocking is all about violating this pattern :) --- In most mocks (MockScheduler, MockExecutor, etc) we pass those around as pointers to stack-allocated variables. For a few mocks (MockMesosContainerizerProcess, MockIsolator, MockContainerLogger), we pass these around as `Owned<...>`. For example: https://github.com/apache/mesos/blob/master/src/tests/containerizer/mesos_containerizer_tests.cpp#L628 - Joseph ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41962/#review114414 ----------------------------------------------------------- On Jan. 12, 2016, 2:31 p.m., Joseph Wu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41962/ > ----------------------------------------------------------- > > (Updated Jan. 12, 2016, 2:31 p.m.) > > > Review request for mesos, Benjamin Hindman, Gilbert Song, Artem Harutyunyan, > Jie Yu, and Timothy Chen. > > > Bugs: MESOS-4150 > https://issues.apache.org/jira/browse/MESOS-4150 > > > Repository: mesos > > > Description > ------- > > Adds two heavily-mocked tests for the Mesos containerizer and Docker > containerizer. Each checks that `ContainerLogger::recover` is called during > `Containerizer::recover`. > > > Diffs > ----- > > src/tests/container_logger_tests.cpp > c6b2e597517c74a55649287dc5ae5a3115f9a640 > src/tests/mesos.hpp 3d9ebc6c9dc3cd1be02dc3771fbd847386907fac > src/tests/mesos.cpp 365ebe8335c37bfdb983a5424d4c995fa9b76a22 > > Diff: https://reviews.apache.org/r/41962/diff/ > > > Testing > ------- > > make (OSX & Centos7) > > Tests are run in the next review. > > > Thanks, > > Joseph Wu > >
