You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/12/13 18:53:55 UTC

[2/2] mesos git commit: Acked correct task id in DefaultExecutorTest.KillTask test.

Acked correct task id in DefaultExecutorTest.KillTask test.

When acknowledging task status updates, this test was erroneously
using a cached task id instead of the actual task id sent in the
status update. This can lead to failed acknowledgements when
status updates appear in different order.

This patch just uses the task id sent as part of the status update in
the acknowledgement.

Review: https://reviews.apache.org/r/54663/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f542c294
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f542c294
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f542c294

Branch: refs/heads/master
Commit: f542c29400f5be390668003b865b5b69f0ff0894
Parents: 119c439
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Tue Dec 13 10:52:15 2016 -0800
Committer: Anand Mazumdar <an...@apache.org>
Committed: Tue Dec 13 10:52:15 2016 -0800

----------------------------------------------------------------------
 src/tests/default_executor_tests.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f542c294/src/tests/default_executor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/default_executor_tests.cpp b/src/tests/default_executor_tests.cpp
index c92b8fe..d5a186e 100644
--- a/src/tests/default_executor_tests.cpp
+++ b/src/tests/default_executor_tests.cpp
@@ -374,7 +374,10 @@ TEST_P(DefaultExecutorTest, KillTask)
     call.set_type(Call::ACKNOWLEDGE);
 
     Call::Acknowledge* acknowledge = call.mutable_acknowledge();
-    acknowledge->mutable_task_id()->CopyFrom(taskInfo1.task_id());
+
+    acknowledge->mutable_task_id()->CopyFrom(
+        runningUpdate1->status().task_id());
+
     acknowledge->mutable_agent_id()->CopyFrom(offer.agent_id());
     acknowledge->set_uuid(runningUpdate1->status().uuid());
 
@@ -387,7 +390,10 @@ TEST_P(DefaultExecutorTest, KillTask)
     call.set_type(Call::ACKNOWLEDGE);
 
     Call::Acknowledge* acknowledge = call.mutable_acknowledge();
-    acknowledge->mutable_task_id()->CopyFrom(taskInfo2.task_id());
+
+    acknowledge->mutable_task_id()->CopyFrom(
+        runningUpdate2->status().task_id());
+
     acknowledge->mutable_agent_id()->CopyFrom(offer.agent_id());
     acknowledge->set_uuid(runningUpdate2->status().uuid());