----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41672/#review113711 -----------------------------------------------------------
Looking good. Just some minor suggestions here and there. src/tests/hierarchical_allocator_tests.cpp (line 224) <https://reviews.apache.org/r/41672/#comment174517> No need to make a `const double` since it's passed by value anyway. Just use `double weight`. src/tests/hierarchical_allocator_tests.cpp (line 2095) <https://reviews.apache.org/r/41672/#comment174518> When did we start initializing string constants with braces instead of '='s? What's the benefit? src/tests/hierarchical_allocator_tests.cpp (lines 2096 - 2101) <https://reviews.apache.org/r/41672/#comment174520> Please be consistent in your use of `i++` vs. `++i` in scalar loops where the order doesn't matter. Looks like we tend to use `i++` much more often. src/tests/hierarchical_allocator_tests.cpp (line 2110) <https://reviews.apache.org/r/41672/#comment174521> s/register/registers/g s/using/uses/g src/tests/hierarchical_allocator_tests.cpp (line 2111) <https://reviews.apache.org/r/41672/#comment174522> s/allocated/offered/ src/tests/hierarchical_allocator_tests.cpp (line 2118) <https://reviews.apache.org/r/41672/#comment174523> s/have been allocated/have outstanding offers/ src/tests/hierarchical_allocator_tests.cpp (lines 2125 - 2126) <https://reviews.apache.org/r/41672/#comment174525> If all parameters don't fit on one line, then each parameter should get its own line. Please wrap `allocation.get().resources` onto its own line. src/tests/hierarchical_allocator_tests.cpp (line 2126) <https://reviews.apache.org/r/41672/#comment174526> How do you know that the `allocation` Future is ready yet? Better AWAIT_READY? src/tests/hierarchical_allocator_tests.cpp (line 2145) <https://reviews.apache.org/r/41672/#comment174527> two resources, namely cpus and mem? Or one for each of the 2 agents allocated to this framework? src/tests/hierarchical_allocator_tests.cpp (lines 2218 - 2219) <https://reviews.apache.org/r/41672/#comment174530> Why hardcode 3? I'd think you could just run a while loop and actually assert the size that you think the allocations hashmap will be. (And what key will be in each entry.) src/tests/hierarchical_allocator_tests.cpp (lines 2223 - 2234) <https://reviews.apache.org/r/41672/#comment174531> Why is the resource ratio 2:1:1 when the weight ratio is 3:1:2? Seems like you might want to add more nodes to get a proper ratio? - Adam B On Jan. 4, 2016, 9:46 p.m., Yongqiao Wang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41672/ > ----------------------------------------------------------- > > (Updated Jan. 4, 2016, 9:46 p.m.) > > > Review request for mesos, Adam B, Neil Conway, and Qian Zhang. > > > Bugs: MESOS-4200 > https://issues.apache.org/jira/browse/MESOS-4200 > > > Repository: mesos > > > Description > ------- > > Test case(s) for weights + allocation behavior > > > Diffs > ----- > > src/tests/hierarchical_allocator_tests.cpp > e044f832c2c16e53e663c6ced5452649bb0dcb59 > > Diff: https://reviews.apache.org/r/41672/diff/ > > > Testing > ------- > > Make check done: > Yongs-MacBook-Pro:build yqwyq$ ./src/mesos-tests > --gtest_filter=HierarchicalAllocatorTest.UpdateWeight > Source directory: /Users/yqwyq/Desktop/mesos > Build directory: /Users/yqwyq/Desktop/mesos/build > [==========] Running 1 test from 1 test case. > [----------] Global test environment set-up. > [----------] 1 test from HierarchicalAllocatorTest > [ RUN ] HierarchicalAllocatorTest.UpdateWeight > [ OK ] HierarchicalAllocatorTest.UpdateWeight (87 ms) > [----------] 1 test from HierarchicalAllocatorTest (87 ms total) > > [----------] Global test environment tear-down > [==========] 1 test from 1 test case ran. (176 ms total) > [ PASSED ] 1 test. > > > Thanks, > > Yongqiao Wang > >
