You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gr...@apache.org on 2018/05/08 16:15:26 UTC

mesos git commit: Fixed flakiness in a `MasterSlaveReconciliationTest`.

Repository: mesos
Updated Branches:
  refs/heads/master 9c54841cb -> 25176ed1b


Fixed flakiness in a `MasterSlaveReconciliationTest`.

The test `ReconcileDroppedOperation` uses detection of a
`ReconcileOperationsMessage` to confirm correct agent reregistration
behavior. For that it drops an operation on its way to the agent, and
then tries to observe the `ReconcileOperationsMessage` when the agent
reregisters after a simulated master failover.

Since `ReconcileOperationsMessage` is sent whenever the master detects
discrepancy between its own operation state of the agent and the
information sent by the agent in an `UpdateSlaveMessage` we need to
make sure to only drop the operation once the agent has sent the
update which is part of its initial registration sequence.

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


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

Branch: refs/heads/master
Commit: 25176ed1b30a9f7fb82a71bca16a423343ba6d5c
Parents: 9c54841
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Tue May 8 08:58:12 2018 -0700
Committer: Greg Mann <gr...@gmail.com>
Committed: Tue May 8 08:58:12 2018 -0700

----------------------------------------------------------------------
 src/tests/master_slave_reconciliation_tests.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/25176ed1/src/tests/master_slave_reconciliation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_slave_reconciliation_tests.cpp b/src/tests/master_slave_reconciliation_tests.cpp
index 937bab0..d09a235 100644
--- a/src/tests/master_slave_reconciliation_tests.cpp
+++ b/src/tests/master_slave_reconciliation_tests.cpp
@@ -363,9 +363,18 @@ TEST_F(MasterSlaveReconciliationTest, ReconcileDroppedOperation)
 
   StandaloneMasterDetector detector(master.get()->pid);
 
+  Future<UpdateSlaveMessage> updateSlaveMessage =
+    FUTURE_PROTOBUF(UpdateSlaveMessage(), _, _);
+
   Try<Owned<cluster::Slave>> slave = StartSlave(&detector);
   ASSERT_SOME(slave);
 
+  // Since any out-of-sync operation state in `UpdateSlaveMessage` triggers a
+  // reconciliation, await the message from the initial agent registration
+  // sequence beforce continuing. Otherwise we risk the master reconciling with
+  // the agent before we fail over the master.
+  AWAIT_READY(updateSlaveMessage);
+
   // Register the framework in a non-`*` role so it can reserve resources.
   FrameworkInfo frameworkInfo = DEFAULT_FRAMEWORK_INFO;
   frameworkInfo.set_roles(0, DEFAULT_TEST_ROLE);