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 2018/03/27 22:04:30 UTC

mesos git commit: Fixed an oversubscription test for agent registration backoff.

Repository: mesos
Updated Branches:
  refs/heads/master f8b400b77 -> 21e4b45b3


Fixed an oversubscription test for agent registration backoff.

In the `OversubscriptionTest.ForwardUpdateSlaveMessage` test we
observe a single `UpdateSlaveMessage` to make sure the agent has fully
recovered. This message is sent from the resource provider-capable
agent to communicate its (empty) set of resource providers after
registration.

Since message was sent with a running clock, it is possible that the
agent encounters a timeout of its registration backoff timers. The
agent would then register agent, triggering another similar message
which is not expected in the test.

This patch adjusts the test to always run with paused clock
eliminating this particular scenario.

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


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

Branch: refs/heads/master
Commit: 21e4b45b388d0b272236b1c58313569f8a1d1fc8
Parents: f8b400b
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Wed Mar 28 00:04:13 2018 +0200
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Wed Mar 28 00:04:13 2018 +0200

----------------------------------------------------------------------
 src/tests/oversubscription_tests.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/21e4b45b/src/tests/oversubscription_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/oversubscription_tests.cpp b/src/tests/oversubscription_tests.cpp
index 47c51e3..e2bd8d4 100644
--- a/src/tests/oversubscription_tests.cpp
+++ b/src/tests/oversubscription_tests.cpp
@@ -283,6 +283,8 @@ TEST_F(OversubscriptionTest, FetchResourceUsage)
 // oversubscribed resources to the master.
 TEST_F(OversubscriptionTest, ForwardUpdateSlaveMessage)
 {
+  Clock::pause();
+
   Try<Owned<cluster::Master>> master = StartMaster();
   ASSERT_SOME(master);
 
@@ -306,12 +308,15 @@ TEST_F(OversubscriptionTest, ForwardUpdateSlaveMessage)
     StartSlave(detector.get(), &resourceEstimator, flags);
   ASSERT_SOME(slave);
 
+  Clock::advance(flags.registration_backoff_factor);
+  Clock::advance(flags.authentication_backoff_factor);
+  Clock::settle();
+
   AWAIT_READY(updateSlaveMessage);
 
   Future<UpdateSlaveMessage> update =
     FUTURE_PROTOBUF(UpdateSlaveMessage(), _, _);
 
-  Clock::pause();
   // No update should be sent until there is an estimate.
   Clock::advance(flags.oversubscribed_resources_interval);
   Clock::settle();