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

cfnatali 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 649ac0958 Fixed OversubscriptionTest.FixedResourceEstimator. (#434)
649ac0958 is described below

commit 649ac0958d04bc079f993018cd3c06726cc54007
Author: cf-natali <cf.nat...@gmail.com>
AuthorDate: Sun May 1 21:08:05 2022 +0100

    Fixed OversubscriptionTest.FixedResourceEstimator. (#434)
    
    Depending on the recovery timing, the slave could send an
    `UpdateSlaveMessage` message before the resource estimator is ready, so
    if that's the case, wait for another update.
---
 src/tests/oversubscription_tests.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/tests/oversubscription_tests.cpp 
b/src/tests/oversubscription_tests.cpp
index edb95867c..8ff93d291 100644
--- a/src/tests/oversubscription_tests.cpp
+++ b/src/tests/oversubscription_tests.cpp
@@ -703,6 +703,22 @@ TEST_F(OversubscriptionTest, FixedResourceEstimator)
   Clock::settle();
 
   AWAIT_READY(update);
+
+  // Depending on the recovery timing, the slave could send an
+  // UpdateSlaveMessage message before the resource estimator is
+  // ready, so if that's the case, wait for another update.
+  if (!update->has_update_oversubscribed_resources() ||
+      !update->update_oversubscribed_resources()) {
+    Future<UpdateSlaveMessage> update1 =
+      FUTURE_PROTOBUF(UpdateSlaveMessage(), _, _);
+
+    Clock::advance(flags.oversubscribed_resources_interval);
+    Clock::settle();
+
+    AWAIT_READY(update1);
+    update = update1;
+  }
+
   ASSERT_TRUE(update->has_update_oversubscribed_resources());
   ASSERT_TRUE(update->update_oversubscribed_resources());
 

Reply via email to