18480: Applies the suggested patch, adjusts the tests to kill the producer.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 26 Nov 2021 15:33:19 +0000 (12:33 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 26 Nov 2021 15:33:19 +0000 (12:33 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

sdk/python/arvados/commands/put.py
sdk/python/tests/test_arv_put.py

index f6f85ba69619ba930cca9efd20d3b4f134f28527..be7cd629c98cfbac0ff36be2ce10c4de2c30cf2e 100644 (file)
@@ -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:
index 5ed356ff9e27c1d4adae103af5c8970425c7208e..3a24e80861c953dc9b79663850b01cfd9325208d 100644 (file)
@@ -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')))