diff options
author | Jürg Billeter <j@bitron.ch> | 2020-04-20 11:50:19 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2020-04-20 11:52:17 +0200 |
commit | 5d3c72fd1ee440cf487aa06756ab70baf4efe6af (patch) | |
tree | 5e662b6790017253f58d9522290522114f0034c2 /tests/sources | |
parent | f093e630d6d4272930f45595d5f1b069879412ce (diff) | |
download | buildstream-5d3c72fd1ee440cf487aa06756ab70baf4efe6af.tar.gz |
tests/sources/tar.py: Fix flaky test_out_of_basedir_hardlinksjuerg/tar-hardlinks
Don't recursively add `contents` to the tar file as the order is not
guaranteed. We need to add `elsewhere` before `to_extract` as the latter
references the former in `linkname`.
Diffstat (limited to 'tests/sources')
-rw-r--r-- | tests/sources/tar.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/sources/tar.py b/tests/sources/tar.py index 8ac627492..ed662dcd2 100644 --- a/tests/sources/tar.py +++ b/tests/sources/tar.py @@ -405,7 +405,12 @@ def test_out_of_basedir_hardlinks(cli, tmpdir, datafiles): old_dir = os.getcwd() os.chdir(str(tmpdir)) with tarfile.open(src_tar, "w:gz") as tar: - tar.add("contents", filter=ensure_link) + # Don't recursively add `contents` as the order is not guaranteed. + # We need to add `elsewhere` before `to_extract` as the latter + # references the former in `linkname`. + tar.add("contents", recursive=False) + tar.add("contents/elsewhere") + tar.add("contents/to_extract", filter=ensure_link) os.chdir(old_dir) # Make sure our tarfile is actually created with the desired |