You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2018/10/26 23:38:19 UTC

[mesos] branch master updated: Fixed test `MasterTestPrePostReservationRefinement.LaunchGroup`.

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

josephwu 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 c7bd85a  Fixed test `MasterTestPrePostReservationRefinement.LaunchGroup`.
c7bd85a is described below

commit c7bd85ae62824c77697ecaf55c8de5cf16788e3e
Author: Meng Zhu <mz...@mesosphere.io>
AuthorDate: Fri Oct 26 16:32:04 2018 -0700

    Fixed test `MasterTestPrePostReservationRefinement.LaunchGroup`.
    
    Added a missing scheduler acknowledgment call so that both
    expected task status updates can be delivered (instead of just one).
    
    Review: https://reviews.apache.org/r/69178/
---
 src/tests/master_tests.cpp | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 1db8ed7..ac6bf37 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -9559,10 +9559,26 @@ TEST_P(MasterTestPrePostReservationRefinement, LaunchGroup)
   v1::TaskGroupInfo taskGroup;
   taskGroup.add_tasks()->CopyFrom(taskInfo);
 
+  testing::Sequence updateSequence;
   Future<v1::scheduler::Event::Update> startingUpdate;
   Future<v1::scheduler::Event::Update> runningUpdate;
-  EXPECT_CALL(*scheduler, update(_, _))
-    .WillOnce(FutureArg<1>(&startingUpdate))
+
+  EXPECT_CALL(
+      *scheduler,
+      update(_, AllOf(
+          TaskStatusUpdateTaskIdEq(taskInfo),
+          TaskStatusUpdateStateEq(v1::TASK_STARTING))))
+    .InSequence(updateSequence)
+    .WillOnce(DoAll(
+        FutureArg<1>(&startingUpdate),
+        v1::scheduler::SendAcknowledge(frameworkId, agentId)));
+
+  EXPECT_CALL(
+      *scheduler,
+      update(_, AllOf(
+            TaskStatusUpdateTaskIdEq(taskInfo),
+            TaskStatusUpdateStateEq(v1::TASK_RUNNING))))
+    .InSequence(updateSequence)
     .WillOnce(FutureArg<1>(&runningUpdate));
 
   {
@@ -9586,17 +9602,8 @@ TEST_P(MasterTestPrePostReservationRefinement, LaunchGroup)
   }
 
   AWAIT_READY(startingUpdate);
-
-  EXPECT_EQ(v1::TASK_STARTING, startingUpdate->status().state());
-  EXPECT_EQ(taskInfo.task_id(), startingUpdate->status().task_id());
-  EXPECT_TRUE(startingUpdate->status().has_timestamp());
-
   AWAIT_READY(runningUpdate);
 
-  EXPECT_EQ(v1::TASK_STARTING, runningUpdate->status().state());
-  EXPECT_EQ(taskInfo.task_id(), runningUpdate->status().task_id());
-  EXPECT_TRUE(runningUpdate->status().has_timestamp());
-
   // Ensure that the task sandbox symbolic link is created.
   EXPECT_TRUE(os::exists(path::join(
       slave::paths::getExecutorLatestRunPath(