X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b87497a3d21d6cbec394a4c595bf62f9d1f11019..864592f6892f3a7a9268a5649430b6af77170122:/sdk/python/tests/test_arv_put.py?ds=sidebyside diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py index 5ed356ff9e..afdf2238a7 100644 --- a/sdk/python/tests/test_arv_put.py +++ b/sdk/python/tests/test_arv_put.py @@ -293,18 +293,24 @@ 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 test_non_regular_files_are_ignored_except_symlinks_to_dirs(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) + fifo_path = os.path.join(self.tempdir_with_symlink, fifo_filename) + self.assertTrue(os.path.islink(os.path.join(self.tempdir_with_symlink, 'linkeddir'))) os.mkfifo(fifo_path) producer = multiprocessing.Process(target=pfunc, args=(fifo_path,)) producer.start() - cwriter = arv_put.ArvPutUploadJob([self.tempdir]) + cwriter = arv_put.ArvPutUploadJob([self.tempdir_with_symlink]) cwriter.start(save_collection=False) - producer.join() + if producer.exitcode is None: + # If the producer is still running, kill it. This should always be + # before any assertion that may fail. + producer.terminate() + producer.join(1) + self.assertIn('linkeddir', cwriter.manifest_text()) self.assertNotIn(fifo_filename, cwriter.manifest_text()) def test_symlinks_are_followed_by_default(self): @@ -807,6 +813,7 @@ class ArvadosPutTest(run_test_server.TestCaseWithServers, def test_put_block_replication(self): self.call_main_on_test_file() + arv_put.api_client = None with mock.patch('arvados.collection.KeepClient.local_store_put') as put_mock: put_mock.return_value = 'acbd18db4cc2f85cedef654fccc4a4d8+3' self.call_main_on_test_file(['--replication', '1'])