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/05/08 17:03:11 UTC

[2/2] mesos git commit: Fixed flakyness in 'MasterAPITest.MasterFailover'.

Fixed flakyness in 'MasterAPITest.MasterFailover'.

This test used to be sporadically segfault as described in MESOS-8687.
The suspected cause is that a in a master actor, the `httpSequence`
field was lazily initialized in `ProcessBase::consume()` and afterwards
a call to `ProcessBase::_consume()` was dispatched, where it was
assumed that `httpSequence` is already initialized.

However, during this test the master actor would be destroyed and a
new actor would be spawned with the same PID. The dispatched method
would be called on this new actor and find `httpSequence` to be not
initialized, leading to a crash.

This patch introduces a call to `Clock::settle()` after the master
is shut down to ensure the outstanding `_consume()` gets discarded
before starting the new master actor.

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


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

Branch: refs/heads/master
Commit: 86523d3157d36bdaf4f7ce8fe001ae241e690a5f
Parents: 6d97f68
Author: Benno Evers <be...@mesosphere.com>
Authored: Tue May 8 19:02:51 2018 +0200
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Tue May 8 19:02:51 2018 +0200

----------------------------------------------------------------------
 src/tests/api_tests.cpp | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/86523d31/src/tests/api_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/api_tests.cpp b/src/tests/api_tests.cpp
index 1ed26a7..00cd91c 100644
--- a/src/tests/api_tests.cpp
+++ b/src/tests/api_tests.cpp
@@ -2472,6 +2472,8 @@ TEST_P(MasterAPITest, MasterFailover)
   mesos.reset();
   master->reset();
 
+  Clock::settle();
+
   // Restart the master.
   master = StartMaster(masterFlags);
   ASSERT_SOME(master);