You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2017/10/17 00:44:30 UTC

[11/14] mesos git commit: Fixed a race when the first agent retries to register.

Fixed a race when the first agent retries to register.

The first agent can retry registration, which can erroneously satisfy
the `SlaveRegisteredMessage` expectation for the second agent.

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


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

Branch: refs/heads/master
Commit: a6bd245bc8dcb8f4b5e24d7a3c189cba4906ca5a
Parents: adecb9a
Author: Alexander Rukletsov <al...@apache.org>
Authored: Sat Oct 14 15:57:39 2017 -0700
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Mon Oct 16 17:42:43 2017 -0700

----------------------------------------------------------------------
 src/tests/persistent_volume_endpoints_tests.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a6bd245b/src/tests/persistent_volume_endpoints_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/persistent_volume_endpoints_tests.cpp b/src/tests/persistent_volume_endpoints_tests.cpp
index cd83abc..444737a 100644
--- a/src/tests/persistent_volume_endpoints_tests.cpp
+++ b/src/tests/persistent_volume_endpoints_tests.cpp
@@ -63,6 +63,7 @@ using process::http::Response;
 using process::http::Unauthorized;
 
 using testing::_;
+using testing::Not;
 using testing::Return;
 
 namespace mesos {
@@ -1802,8 +1803,10 @@ TEST_F(PersistentVolumeEndpointsTest, ReserveAndSlaveRemoval)
 
   const SlaveID& slaveId1 = slave1RegisteredMessage->slave_id();
 
+  // Capture the registration message for the second agent.
   Future<SlaveRegisteredMessage> slave2RegisteredMessage =
-    FUTURE_PROTOBUF(SlaveRegisteredMessage(), master.get()->pid, _);
+    FUTURE_PROTOBUF(
+        SlaveRegisteredMessage(), master.get()->pid, Not(slave1.get()->pid));
 
   // Each slave needs its own flags to ensure work_dirs are unique.
   slave::Flags slave2Flags = CreateSlaveFlags();