> On Oct. 20, 2014, 4:53 a.m., Benjamin Hindman wrote:
> > src/tests/docker_containerizer_tests.cpp, line 466
> > <https://reviews.apache.org/r/26862/diff/3/?file=724766#file724766line466>
> >
> >     Let's do this right and set up EXPECT_CALLs like we do with other 
> > mocks. :-)

Do you know what's the easiest way to setup a EXPECT_CALL that saves the 
function return value? I've been trying to look for existing gmock function but 
the easiest I can come up with is:

void CaptureLog(
    MockDocker* docker,
    const string& container,
    const string& directory,
    Future<Nothing>* future)
{
  *future = docker->_logs(container, directory);
}

 string container;
  string directory;
  Future<Nothing> logsFuture;
  EXPECT_CALL(*docker, logs(_, _))
    .WillRepeatedly(
        InvokeAll(
            SaveArg<0>(&container),
            SaveArg<1>(&directory),
            CaptureLog(docker, container, directory, &logsFuture)));
            
vs

Originally I just need to AWAIT_READY(docker->logsFuture)


- Timothy


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26862/#review57308
-----------------------------------------------------------


On Oct. 17, 2014, 7:33 p.m., Timothy Chen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26862/
> -----------------------------------------------------------
> 
> (Updated Oct. 17, 2014, 7:33 p.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Docker tests are flaky, mostly around getting expected output from the docker 
> container forwarded to stdout/stderr.
> 
> This is due to Docker not always have the stdout/stderr output available for 
> docker logs if kill/rm is called.
> 
> 
> Diffs
> -----
> 
>   src/docker/docker.hpp 9656f15 
>   src/docker/docker.cpp e09b51c 
>   src/slave/containerizer/docker.hpp fbbd45d 
>   src/slave/containerizer/docker.cpp 9a29489 
>   src/tests/docker_containerizer_tests.cpp 67d60a8 
>   src/tests/docker_tests.cpp 04139af 
>   src/tests/environment.cpp 4dd78e7 
> 
> Diff: https://reviews.apache.org/r/26862/diff/
> 
> 
> Testing
> -------
> 
> make with gtest_repeat=-1 gtest_shuffle=1
> 
> 
> Thanks,
> 
> Timothy Chen
> 
>

Reply via email to