You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jie Yu <yu...@gmail.com> on 2016/12/16 22:11:27 UTC

Re: Review Request 54034: Introduced common fixture to PosixRLimitsIsolatorTest.

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




src/tests/containerizer/posix_rlimits_isolator_tests.cpp (lines 53 - 87)
<https://reviews.apache.org/r/54034/#comment230512>

    I don't like this refactor. I like the test to be self contained. I am fine introducing some helpers in the fixture to simply the actual test. But I don't like having assertions in test fixture itself.
    
    I don't be too worried about the code duplication here. That's what we did in many other tests as well. I found it being more readable than factoring the common parts into the fixture.


- Jie Yu


On Dec. 5, 2016, 12:44 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54034/
> -----------------------------------------------------------
> 
> (Updated Dec. 5, 2016, 12:44 p.m.)
> 
> 
> Review request for mesos, Jie Yu and Till Toenshoff.
> 
> 
> Bugs: MESOS-6402
>     https://issues.apache.org/jira/browse/MESOS-6402
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Introduced common fixture to PosixRLimitsIsolatorTest.
> 
> 
> Diffs
> -----
> 
>   src/tests/containerizer/posix_rlimits_isolator_tests.cpp 24b19d9eb1cc3e19f8325fbd76182837a5690581 
> 
> Diff: https://reviews.apache.org/r/54034/diff/
> 
> 
> Testing
> -------
> 
> `make check` (OS X, clang trunk w/o optimizations)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 54034: Introduced common fixture to PosixRLimitsIsolatorTest.

Posted by Benjamin Bannier <be...@mesosphere.io>.

> On Dec. 16, 2016, 11:11 p.m., Jie Yu wrote:
> > src/tests/containerizer/posix_rlimits_isolator_tests.cpp, lines 53-93
> > <https://reviews.apache.org/r/54034/diff/1/?file=1569374#file1569374line53>
> >
> >     I don't like this refactor. I like the test to be self contained. I am fine introducing some helpers in the fixture to simply the actual test. But I don't like having assertions in test fixture itself.
> >     
> >     I don't be too worried about the code duplication here. That's what we did in many other tests as well. I found it being more readable than factoring the common parts into the fixture.

I guess there is no point arguing with taste here, so I am dropping this patch.

As a note, it is fine to use gtest assertions in a fixture's `SetUp`. If an assertion fails there, test cases relying on the fixture will not be executed.


- Benjamin


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


On Dec. 5, 2016, 1:44 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54034/
> -----------------------------------------------------------
> 
> (Updated Dec. 5, 2016, 1:44 p.m.)
> 
> 
> Review request for mesos, Jie Yu and Till Toenshoff.
> 
> 
> Bugs: MESOS-6402
>     https://issues.apache.org/jira/browse/MESOS-6402
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Introduced common fixture to PosixRLimitsIsolatorTest.
> 
> 
> Diffs
> -----
> 
>   src/tests/containerizer/posix_rlimits_isolator_tests.cpp 24b19d9eb1cc3e19f8325fbd76182837a5690581 
> 
> Diff: https://reviews.apache.org/r/54034/diff/
> 
> 
> Testing
> -------
> 
> `make check` (OS X, clang trunk w/o optimizations)
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>