You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2015/12/03 15:40:25 UTC

mesos git commit: Fixed test flakiness in FetcherTest and FetcherCacheTest.

Repository: mesos
Updated Branches:
  refs/heads/master 47fe84b66 -> d723c45e0


Fixed test flakiness in FetcherTest and FetcherCacheTest.

GNU tar-1.28 and earlier can relatively randomly misidentify
compressed files as uncompressed ones, and will then fail when
unpacking. Avoid compressed tar files in some tests where we know we
directly call the tar system command (in mesos-fetcher in this case).

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


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

Branch: refs/heads/master
Commit: d723c45e043670f440bacd381826b5359e48b345
Parents: 47fe84b
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Thu Dec 3 15:39:54 2015 +0100
Committer: Bernd Mathiske <be...@mesosphere.io>
Committed: Thu Dec 3 15:39:55 2015 +0100

----------------------------------------------------------------------
 src/tests/fetcher_cache_tests.cpp | 4 +++-
 src/tests/fetcher_tests.cpp       | 9 +++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d723c45e/src/tests/fetcher_cache_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/fetcher_cache_tests.cpp b/src/tests/fetcher_cache_tests.cpp
index ac5ad6a..fb0b3ba 100644
--- a/src/tests/fetcher_cache_tests.cpp
+++ b/src/tests/fetcher_cache_tests.cpp
@@ -322,7 +322,9 @@ void FetcherCacheTest::setupArchiveAsset()
 
   const string cwd = os::getcwd();
   ASSERT_SOME(os::chdir(assetsDirectory));
-  ASSERT_SOME(os::tar(ARCHIVED_COMMAND_NAME, ARCHIVE_NAME));
+  // Create an uncompressed archive (see MESOS-3579).
+  ASSERT_SOME(os::shell(
+      "tar cf '" + ARCHIVE_NAME + "' '" + ARCHIVED_COMMAND_NAME + "' 2>&1"));
   ASSERT_SOME(os::chdir(cwd));
   archivePath = path::join(assetsDirectory, ARCHIVE_NAME);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/d723c45e/src/tests/fetcher_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/fetcher_tests.cpp b/src/tests/fetcher_tests.cpp
index eb31475..069c9bc 100644
--- a/src/tests/fetcher_tests.cpp
+++ b/src/tests/fetcher_tests.cpp
@@ -506,7 +506,10 @@ TEST_F(FetcherTest, ExtractNotExecutable)
   // TODO(benh): Update os::tar so that we can capture or ignore
   // stdout/stderr output.
 
-  ASSERT_SOME(os::tar(path.get(), path.get() + ".tar.gz"));
+  // Create an uncompressed archive (see MESOS-3579), but with
+  // extension `.tar.gz` to verify we can unpack files such names.
+  ASSERT_SOME(os::shell(
+      "tar cf '" + path.get() + ".tar.gz' '" + path.get() + "' 2>&1"));
 
   ContainerID containerId;
   containerId.set_value(UUID::random().toString());
@@ -556,7 +559,9 @@ TEST_F(FetcherTest, ExtractTar)
   // TODO(benh): Update os::tar so that we can capture or ignore
   // stdout/stderr output.
 
-  ASSERT_SOME(os::tar(path.get(), path.get() + ".tar"));
+  // Create an uncompressed archive (see MESOS-3579).
+  ASSERT_SOME(os::shell(
+      "tar cf '" + path.get() + ".tar' '" + path.get() + "' 2>&1"));
 
   ContainerID containerId;
   containerId.set_value(UUID::random().toString());