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

chhsiao 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 7db4ae6  Fixed 
`PartitionTest.PartitionAwareTaskCompletedOnPartitionedAgent`.
7db4ae6 is described below

commit 7db4ae68a8febd6faf2c38eedb52210ff5192506
Author: Chun-Hung Hsiao <[email protected]>
AuthorDate: Tue Mar 5 16:38:42 2019 -0800

    Fixed `PartitionTest.PartitionAwareTaskCompletedOnPartitionedAgent`.
    
    The test flake is fixed by adding proper synchronizations to ensure that
    the agent's task status update manager has received task status updates
    before moving on.
    
    Review: https://reviews.apache.org/r/70134
---
 src/tests/partition_tests.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/tests/partition_tests.cpp b/src/tests/partition_tests.cpp
index 6cdfe973..8148aff 100644
--- a/src/tests/partition_tests.cpp
+++ b/src/tests/partition_tests.cpp
@@ -2559,11 +2559,16 @@ TEST_F(PartitionTest, 
PartitionAwareTaskCompletedOnPartitionedAgent)
   AWAIT_READY(execTask);
 
   {
+    Future<Nothing> ___statusUpdate =
+      FUTURE_DISPATCH(slave.get()->pid, &Slave::___statusUpdate);
+
     TaskStatus runningStatus;
     runningStatus.mutable_task_id()->MergeFrom(execTask->task_id());
     runningStatus.set_state(TASK_RUNNING);
 
     execDriver->sendStatusUpdate(runningStatus);
+
+    AWAIT_READY(___statusUpdate);
   }
 
   AWAIT_READY(runningAtScheduler);
@@ -2606,11 +2611,16 @@ TEST_F(PartitionTest, 
PartitionAwareTaskCompletedOnPartitionedAgent)
 
   // Have the executor inform the slave that the task has finished.
   {
+    Future<Nothing> ___statusUpdate =
+      FUTURE_DISPATCH(slave.get()->pid, &Slave::___statusUpdate);
+
     TaskStatus finishedStatus;
     finishedStatus.mutable_task_id()->MergeFrom(execTask->task_id());
     finishedStatus.set_state(TASK_FINISHED);
 
     execDriver->sendStatusUpdate(finishedStatus);
+
+    AWAIT_READY(___statusUpdate);
   }
 
   // Cause the slave to reregister with the master. Because the

Reply via email to