----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/48062/#review138931 -----------------------------------------------------------
Ship it! Ah great, this should come before the `dirty = false` patch, I didn't see that you already fixed this. I'll get this committed shortly. src/tests/sorter_tests.cpp (lines 187 - 220) <https://reviews.apache.org/r/48062/#comment204137> Thank you for the test! I simplified it a bit to make it more consistent with the rest of the tests: ``` TEST(SorterTest, WDRFSorterUpdateWeight) { DRFSorter sorter; SlaveID slaveId; slaveId.set_value("agentId"); Resources totalResources = Resources::parse("cpus:100;mem:100").get(); sorter.add(slaveId, totalResources); sorter.add("a"); sorter.allocated("a", slaveId, Resources::parse("cpus:5;mem:5").get()); sorter.add("b"); sorter.allocated("b", slaveId, Resources::parse("cpus:6;mem:6").get()); // shares: a = .05, b = .06 EXPECT_EQ(list<string>({"a", "b"}), sorter.sort()); // Increase b's weight to flip the sort order. sorter.update("b", 2); // shares: a = .05, b = .03 EXPECT_EQ(list<string>({"b", "a"}), sorter.sort()); } ``` - Benjamin Mahler On June 11, 2016, 4:02 a.m., Guangya Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/48062/ > ----------------------------------------------------------- > > (Updated June 11, 2016, 4:02 a.m.) > > > Review request for mesos, Benjamin Mahler and Klaus Ma. > > > Bugs: MESOS-5601 > https://issues.apache.org/jira/browse/MESOS-5601 > > > Repository: mesos > > > Description > ------- > > Recalculated share when weight was updated. > > > Diffs > ----- > > src/master/allocator/sorter/drf/sorter.cpp > 65d473a5da0d846214c930c14d333040b2085b13 > src/tests/sorter_tests.cpp eb207a36c18198588cd8a98b3860a66c2ff7a641 > > Diff: https://reviews.apache.org/r/48062/diff/ > > > Testing > ------- > > make > make check > > [ RUN ] SorterTest.WDRFSorterUpdateWeight > [ OK ] SorterTest.WDRFSorterUpdateWeight (1 ms) > > > Thanks, > > Guangya Liu > >
