mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <bmah...@apache.org>
Subject Re: Review Request 70472: Ensured that task groups do not specify overlapping ranges or sets.
Date Sat, 20 Apr 2019 18:38:26 GMT

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



Nice!!

Ship it for the code, but still thinking about the tests (feels like there must be a way to
make the really long one succinct, not sure if we have the necessary testing abstractions
yet though). Would be nice to give a ship it on the code and review the tests separately.


src/tests/master_validation_tests.cpp
Lines 456-459 (patched)
<https://reviews.apache.org/r/70472/#comment301036>

    Maybe we can make this more succinct by removing the extra variables?
    
    ```
      Resources resources1 = CHECK_NOTERROR(
          Resources::parse("cpus:0.1;mem:32;disk:32;zones:{a,b,c}"));
    
      ...
    ```
    
    vs
    
    ```
      Try<Resources> resources1_ =
        Resources::parse("cpus:0.1;mem:32;disk:32;zones:{a,b,c}");
      ASSERT_SOME(resources1_);
      Resources resources1 = resources1_.get();
      
      ...
    ```
    
    The former seems more readable?



src/tests/master_validation_tests.cpp
Lines 543-544 (patched)
<https://reviews.apache.org/r/70472/#comment301037>

    Maybe we can even inline (without the low readability variable names (resources1/2)) and
use fewer extraneous resources for increased readability?
    
    ```
    EXPECT_TRUE(
        resource::detectOverlappingSetAndRangeResources({
            CHECK_NOTERROR(Resources::parse("zones:{a,b,c}"),
            CHECK_NOTERROR(Resources::parse("zones:{c,d,e}")
        }));
    ```
    
    vs
    
    ```
      resources1_ = Resources::parse("cpus:0.1;mem:32;disk:32;zones:{a,b,c}");
      ASSERT_SOME(resources1_);
      resources1 = resources1_.get();
    
      resources2_ = Resources::parse("cpus:0.1;mem:32;disk:32;zones:{c,d,e}");
      ASSERT_SOME(resources2_);
      resources2 = resources2_.get();
      
      EXPECT_TRUE(resource::detectOverlappingSetAndRangeResources(
          {resources1, resources2}));
    ```
    
    Seems like doing this might make the test a lot more succinct and readable?


- Benjamin Mahler


On April 20, 2019, 6:20 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70472/
> -----------------------------------------------------------
> 
> (Updated April 20, 2019, 6:20 p.m.)
> 
> 
> Review request for mesos, Benno Evers, Benjamin Mahler, Gastón Kleiman, and Meng Zhu.
> 
> 
> Bugs: MESOS-9619
>     https://issues.apache.org/jira/browse/MESOS-9619
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch adds validation to the master to ensure that task
> groups do not include resources with overlapping set- or
> range-valued resources, as this can crash the allocator.
> 
> 
> Diffs
> -----
> 
>   src/master/validation.hpp 71748c121aa3518d68811ea1e60707d195b58657 
>   src/master/validation.cpp f032a781608857d0c9cfa220dd8d70f74d60f1ec 
>   src/tests/master_tests.cpp 964d935771a99efaee63187affe46b551146f310 
>   src/tests/master_validation_tests.cpp 400ad686291e08f578f27cfb9341263972e36684 
> 
> 
> Diff: https://reviews.apache.org/r/70472/diff/3/
> 
> 
> Testing
> -------
> 
> `make check`
> `bin/mesos-tests.sh --gtest_filter="*NonoverlappingSetsAndRanges*" --gtest_repeat=-1
--gtest_break_on_failure`
> `bin/mesos-tests.sh --gtest_filter="*LaunchGroupOverlappingSetAndRangeResources*" --gtest_repeat=-1
--gtest_break_on_failure`
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message