[ARVADOS] updated: 9609f9a5a4776671f571f765a179506d26df56da

Git user git at public.curoverse.com
Tue Apr 18 12:37:23 EDT 2017


Summary of changes:
 sdk/python/tests/test_arv_get.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

       via  9609f9a5a4776671f571f765a179506d26df56da (commit)
      from  03188ad6eb14ee3dcd6bdf74198624c9358936c5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9609f9a5a4776671f571f765a179506d26df56da
Author: Lucas Di Pentima <lucas at curoverse.com>
Date:   Tue Apr 18 13:36:44 2017 -0300

    11502: Avoid races on test by getting the unstripped manifest version before the comparison.

diff --git a/sdk/python/tests/test_arv_get.py b/sdk/python/tests/test_arv_get.py
index 4feac0f..afbe634 100644
--- a/sdk/python/tests/test_arv_get.py
+++ b/sdk/python/tests/test_arv_get.py
@@ -2,6 +2,7 @@
 # -*- coding: utf-8 -*-
 
 import io
+import os
 import shutil
 import tempfile
 
@@ -80,13 +81,18 @@ class ArvadosGetTestCase(run_test_server.TestCaseWithServers):
         # Get the collection manifest by UUID
         r = self.run_get([self.col_loc, self.tempdir])
         self.assertEqual(0, r)
-        with open("{}/{}".format(self.tempdir, self.col_loc), "r") as f:
-            self.assertEqual(self.col_manifest, f.read())
+        m_from_collection = collection.Collection(self.col_manifest).manifest_text(strip=True)
+        with open(os.path.join(self.tempdir, self.col_loc), "r") as f:
+            # Strip manifest before comparison to avoid races
+            m_from_file = collection.Collection(f.read()).manifest_text(strip=True)
+            self.assertEqual(m_from_collection, m_from_file)
         # Get the collection manifest by PDH
         r = self.run_get([self.col_pdh, self.tempdir])
         self.assertEqual(0, r)
-        with open("{}/{}".format(self.tempdir, self.col_pdh), "r") as f:
-            self.assertEqual(self.col_manifest, f.read())
+        with open(os.path.join(self.tempdir, self.col_pdh), "r") as f:
+            # Strip manifest before comparison to avoid races
+            m_from_file = collection.Collection(f.read()).manifest_text(strip=True)
+            self.assertEqual(m_from_collection, m_from_file)
 
     def test_get_collection_stripped_manifest(self):
         col_loc, col_pdh, col_manifest = self.write_test_collection(strip_manifest=True)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list