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

gilbert 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 1f6a313  Fixed the flaky RoleTest.RolesEndpointContainsConsumedQuota 
test.
1f6a313 is described below

commit 1f6a3134ee30aa9a3e963ca775ba92fc3f619960
Author: Benjamin Mahler <[email protected]>
AuthorDate: Wed Jul 10 10:47:03 2019 -0700

    Fixed the flaky RoleTest.RolesEndpointContainsConsumedQuota test.
    
    When this test was run as root in CI, the --launcher gets implicitly
    set to `linux` whereas it gets implicitly set to `posix` when run
    as non-root. When run as `linux`, the use of cgroups causes the
    agents to detect each other's containers as orphans and kill them.
    
    The fix for now is to force the launcher to be posix.
    
    Review: https://reviews.apache.org/r/71048/
---
 src/tests/role_tests.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/tests/role_tests.cpp b/src/tests/role_tests.cpp
index f7a8234..67830bb 100644
--- a/src/tests/role_tests.cpp
+++ b/src/tests/role_tests.cpp
@@ -497,6 +497,11 @@ TEST_F(RoleTest, RolesEndpointContainsConsumedQuota)
   agentFlags1.resources = "cpus(role):1;mem(role):10;"
                           "disk:0;ports:[]";
 
+  // We need to use the posix launcher to avoid agents
+  // seeing each other's containers as orphans and
+  // killing them.
+  agentFlags1.launcher = "posix";
+
   Owned<MasterDetector> detector = master.get()->createDetector();
   Try<Owned<cluster::Slave>> slave1 = StartSlave(detector.get(), agentFlags1);
 
@@ -540,6 +545,11 @@ TEST_F(RoleTest, RolesEndpointContainsConsumedQuota)
   agentFlags2.resources = "cpus:10;mem:100;"
                           "disk:0;ports:[]";
 
+  // We need to use the posix launcher to avoid agents
+  // seeing each other's containers as orphans and
+  // killing them.
+  agentFlags2.launcher = "posix";
+
   Try<Owned<cluster::Slave>> slave2 = StartSlave(detector.get(), agentFlags2);
 
   AWAIT_READY(task2Launched);
@@ -560,6 +570,11 @@ TEST_F(RoleTest, RolesEndpointContainsConsumedQuota)
                           "cpus:1000;mem:10000;"
                           ";disk:0;ports:[]";
 
+  // We need to use the posix launcher to avoid agents
+  // seeing each other's containers as orphans and
+  // killing them.
+  agentFlags3.launcher = "posix";
+
   Try<Owned<cluster::Slave>> slave3 = StartSlave(detector.get(), agentFlags3);
 
   AWAIT_READY(offer);

Reply via email to