This is an automated email from the ASF dual-hosted git repository.

bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c50403  Fixed an incorrect resource mutation.
5c50403 is described below

commit 5c50403eb233991eaa8f83b5bc50eae2c33d5850
Author: Benjamin Bannier <[email protected]>
AuthorDate: Fri Nov 29 09:27:30 2019 +0100

    Fixed an incorrect resource mutation.
    
    `Resources::pushReservation` does not mutate the `Resources` it is
    invoked on; instead it returns its result which should then be used.
    
    This issue was identified by making `Resources::pushReservation`
    `nodiscard`.
    
    Review: https://reviews.apache.org/r/71732/
---
 src/tests/scheduler_tests.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/tests/scheduler_tests.cpp b/src/tests/scheduler_tests.cpp
index e0ed029..299d3a0 100644
--- a/src/tests/scheduler_tests.cpp
+++ b/src/tests/scheduler_tests.cpp
@@ -1232,9 +1232,8 @@ TEST_P(SchedulerTest, 
OperationFeedbackValidationNoResourceProviderCapability)
   const v1::Offer& offer = offers->offers(0);
 
   v1::Resources resources = v1::Resources::parse("cpus:0.1").get();
-  resources.pushReservation(v1::createDynamicReservationInfo(
-      frameworkInfo.roles(1),
-      frameworkInfo.principal()));
+  resources = resources.pushReservation(v1::createDynamicReservationInfo(
+      frameworkInfo.roles(1), frameworkInfo.principal()));
 
   v1::Offer::Operation operation = v1::RESERVE(resources);
   operation.mutable_id()->set_value("RESERVE_OPERATION");

Reply via email to