> On Jan. 11, 2016, 10:13 a.m., Adam B wrote: > > src/tests/hierarchical_allocator_tests.cpp, lines 2218-2219 > > <https://reviews.apache.org/r/41672/diff/6/?file=1181569#file1181569line2218> > > > > 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.)
allocations is a process::Queue<Allocation>, and I can not get its size due to there is no interface can do this. Could you give me a detailed description for your suggestions? Thanks. In addition, I can make sure there are 3 allocations because in my test case, there are 4 agents and 3 frameworks, and their weights are 3:1:2, so according to the fair share, each framework can get one allocation at least. > On Jan. 11, 2016, 10:13 a.m., Adam B wrote: > > src/tests/hierarchical_allocator_tests.cpp, line 2095 > > <https://reviews.apache.org/r/41672/diff/6/?file=1181569#file1181569line2095> > > > > When did we start initializing string constants with braces instead of > > '='s? What's the benefit? I refer the quota-related code to use {""} (such as master_quota_tests.cpp, and quota tests in this file), actually, I am not sure the difference between them, but in C++ standard library, it uses '=', so I have updated my code to use '=' now. - Yongqiao ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41672/#review113711 ----------------------------------------------------------- On Jan. 5, 2016, 5:46 a.m., Yongqiao Wang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41672/ > ----------------------------------------------------------- > > (Updated Jan. 5, 2016, 5:46 a.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 > >
