You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gi...@apache.org on 2019/01/22 23:00:01 UTC
[mesos] branch master updated: Fixed flakiness by adding per agent
config dir for mesos test.
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 68ee08d Fixed flakiness by adding per agent config dir for mesos test.
68ee08d is described below
commit 68ee08d1ed1bcb3130937ce503b6c9961687c53b
Author: Gilbert Song <so...@gmail.com>
AuthorDate: Wed Jan 16 14:02:07 2019 -0800
Fixed flakiness by adding per agent config dir for mesos test.
In mesos tests, there are some cases that multiple agents are
running simultanuously. From commit 07bccc63, we start to have
agents share the same config dir in the test sandbox. Unit
tests that use the same credicial file dir may fail if there
are agents read and write to the same credential file
simultanuously. We should set unique dir per agent.
Review: https://reviews.apache.org/r/69776
---
src/tests/mesos.cpp | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index 0d51687..df363ab 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -170,19 +170,22 @@ slave::Flags MesosTest::CreateSlaveFlags()
CHECK_SOME(runtimeDir) << "Failed to create temporary directory";
flags.runtime_dir = runtimeDir.get();
- flags.fetcher_cache_dir = path::join(sandbox.get(), "fetch");
+ Try<string> agentDir = os::mkdtemp(path::join(sandbox.get(), "XXXXXX"));
+ CHECK_SOME(agentDir) << "Failed to create temporary directory";
+
+ flags.fetcher_cache_dir = path::join(agentDir.get(), "fetch");
flags.launcher_dir = getLauncherDir();
- flags.appc_store_dir = path::join(sandbox.get(), "store", "appc");
+ flags.appc_store_dir = path::join(agentDir.get(), "store", "appc");
- flags.docker_store_dir = path::join(sandbox.get(), "store", "docker");
+ flags.docker_store_dir = path::join(agentDir.get(), "store", "docker");
- flags.frameworks_home = path::join(sandbox.get(), "frameworks");
+ flags.frameworks_home = path::join(agentDir.get(), "frameworks");
{
// Create a default credential file for master/agent authentication.
- const string& path = path::join(sandbox.get(), "credential");
+ const string& path = path::join(agentDir.get(), "credential");
Try<int_fd> fd = os::open(
path,
@@ -216,7 +219,7 @@ slave::Flags MesosTest::CreateSlaveFlags()
{
// Create a secret key for executor authentication.
- const string path = path::join(sandbox.get(), "jwt_secret_key");
+ const string path = path::join(agentDir.get(), "jwt_secret_key");
Try<int_fd> fd = os::open(
path,
@@ -242,7 +245,7 @@ slave::Flags MesosTest::CreateSlaveFlags()
{
// Create a default HTTP credentials file.
- const string& path = path::join(sandbox.get(), "http_credentials");
+ const string& path = path::join(agentDir.get(), "http_credentials");
Try<int_fd> fd = os::open(
path,