[ARVADOS] created: 2.1.0-1675-g087fe7a4f

Git user git at public.arvados.org
Fri Nov 26 15:34:08 UTC 2021


        at  087fe7a4f739949cbc687508f4eeb7611c5083fa (commit)


commit 087fe7a4f739949cbc687508f4eeb7611c5083fa
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Fri Nov 26 12:33:19 2021 -0300

    18480: Applies the suggested patch, adjusts the tests to kill the producer.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/sdk/python/arvados/commands/put.py b/sdk/python/arvados/commands/put.py
index f6f85ba69..be7cd629c 100644
--- a/sdk/python/arvados/commands/put.py
+++ b/sdk/python/arvados/commands/put.py
@@ -576,6 +576,9 @@ class ArvPutUploadJob(object):
                     files.sort()
                     for f in files:
                         filepath = os.path.join(root, f)
+                        if not os.path.isfile(filepath):
+                            self.logger.warning("Skipping non-regular file '{}'".format(filepath))
+                            continue
                         # Add its size to the total bytes count (if applicable)
                         if self.follow_links or (not os.path.islink(filepath)):
                             if self.bytes_expected is not None:
diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py
index 5ed356ff9..3a24e8086 100644
--- a/sdk/python/tests/test_arv_put.py
+++ b/sdk/python/tests/test_arv_put.py
@@ -304,8 +304,11 @@ class ArvPutUploadJobTest(run_test_server.TestCaseWithServers,
         producer.start()
         cwriter = arv_put.ArvPutUploadJob([self.tempdir])
         cwriter.start(save_collection=False)
-        producer.join()
         self.assertNotIn(fifo_filename, cwriter.manifest_text())
+        if producer.exitcode is None:
+            # If the producer is still running, kill it.
+            producer.terminate()
+            producer.join(1)
 
     def test_symlinks_are_followed_by_default(self):
         self.assertTrue(os.path.islink(os.path.join(self.tempdir_with_symlink, 'linkeddir')))

commit b87497a3d21d6cbec394a4c595bf62f9d1f11019
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Fri Nov 26 12:20:47 2021 -0300

    18480: Adds test exposing the bug.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py
index 2a71f3671..5ed356ff9 100644
--- a/sdk/python/tests/test_arv_put.py
+++ b/sdk/python/tests/test_arv_put.py
@@ -14,10 +14,10 @@ from functools import partial
 import apiclient
 import ciso8601
 import datetime
-import hashlib
 import json
 import logging
 import mock
+import multiprocessing
 import os
 import pwd
 import random
@@ -31,7 +31,6 @@ import tempfile
 import time
 import unittest
 import uuid
-import yaml
 
 import arvados
 import arvados.commands.put as arv_put
@@ -294,6 +293,20 @@ class ArvPutUploadJobTest(run_test_server.TestCaseWithServers,
         shutil.rmtree(self.small_files_dir)
         shutil.rmtree(self.tempdir_with_symlink)
 
+    def test_non_regular_files_are_ignored(self):
+        def pfunc(x):
+            with open(x, 'w') as f:
+                f.write('test')
+        fifo_filename = 'fifo-file'
+        fifo_path = os.path.join(self.tempdir, fifo_filename)
+        os.mkfifo(fifo_path)
+        producer = multiprocessing.Process(target=pfunc, args=(fifo_path,))
+        producer.start()
+        cwriter = arv_put.ArvPutUploadJob([self.tempdir])
+        cwriter.start(save_collection=False)
+        producer.join()
+        self.assertNotIn(fifo_filename, cwriter.manifest_text())
+
     def test_symlinks_are_followed_by_default(self):
         self.assertTrue(os.path.islink(os.path.join(self.tempdir_with_symlink, 'linkeddir')))
         self.assertTrue(os.path.islink(os.path.join(self.tempdir_with_symlink, 'linkedfile')))

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list