Renamed `TaskStatusEq()` to `TaskStatusTaskIdEq()`. Review: https://reviews.apache.org/r/63943/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9ee4da2b Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9ee4da2b Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9ee4da2b Branch: refs/heads/master Commit: 9ee4da2b55cb9c2c67fc5a80078675d0e3da46ab Parents: e6c6ab8 Author: Qian Zhang <zhq527...@gmail.com> Authored: Tue Nov 21 18:39:29 2017 +0100 Committer: Alexander Rukletsov <al...@apache.org> Committed: Tue Nov 21 18:39:29 2017 +0100 ---------------------------------------------------------------------- src/tests/master_tests.cpp | 4 ++-- src/tests/mesos.hpp | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/9ee4da2b/src/tests/master_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp index 139125b..01f45a9 100644 --- a/src/tests/master_tests.cpp +++ b/src/tests/master_tests.cpp @@ -5783,7 +5783,7 @@ TEST_F(MasterTest, MasterFailoverLongLivedExecutor) .WillOnce(SendStatusUpdateFromTask(TASK_RUNNING)); Future<TaskStatus> status1; - EXPECT_CALL(sched, statusUpdate(&driver, TaskStatusEq(task1))) + EXPECT_CALL(sched, statusUpdate(&driver, TaskStatusTaskIdEq(task1))) .WillOnce(FutureArg<1>(&status1)) .WillRepeatedly(Return()); @@ -5815,7 +5815,7 @@ TEST_F(MasterTest, MasterFailoverLongLivedExecutor) task2.mutable_task_id()->set_value("2"); Future<TaskStatus> status2; - EXPECT_CALL(sched, statusUpdate(&driver, TaskStatusEq(task2))) + EXPECT_CALL(sched, statusUpdate(&driver, TaskStatusTaskIdEq(task2))) .WillOnce(FutureArg<1>(&status2)) .WillRepeatedly(Return()); http://git-wip-us.apache.org/repos/asf/mesos/blob/9ee4da2b/src/tests/mesos.hpp ---------------------------------------------------------------------- diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp index d8ca9a3..30b8ac5 100644 --- a/src/tests/mesos.hpp +++ b/src/tests/mesos.hpp @@ -3055,13 +3055,11 @@ void ExpectNoFutureUnionHttpProtobufs( } -// This matcher is used to match the task ids of TaskStatus messages. -// Suppose we set up N futures for LaunchTasks and N futures for StatusUpdates. -// (This is a common pattern). We get into a situation where all StatusUpdates -// are satisfied before the LaunchTasks if the master re-sends StatusUpdates. -// We use this matcher to only satisfy the StatusUpdate future if the -// StatusUpdate came from the corresponding task. -MATCHER_P(TaskStatusEq, task, "") { return arg.task_id() == task.task_id(); } +// This matcher is used to match the task id of `TaskStatus` message. +MATCHER_P(TaskStatusTaskIdEq, taskInfo, "") +{ + return arg.task_id() == taskInfo.task_id(); +} // This matcher is used to match the task id of `Event.update.status` message.