Skip to content

Commit 8fde940

Browse files
committed
Add retry to test_tarfile_vs_tar
1 parent c7b0fa9 commit 8fde940

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

graalpython/lib-python/3/test/test_shutil.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,17 @@ def test_tarfile_vs_tar(self):
17011701
import platform
17021702
if int(platform.mac_ver()[0].split('.')[0]) >= 11:
17031703
tar_cmd.insert(1, '--no-mac-metadata')
1704-
subprocess.check_call(tar_cmd, cwd=root_dir,
1705-
stdout=subprocess.DEVNULL)
1704+
# GraalPy change: retry without --no-mac-metadata, it's not available on all CI machines
1705+
try:
1706+
subprocess.check_call(tar_cmd, cwd=root_dir,
1707+
stdout=subprocess.DEVNULL)
1708+
except subprocess.CalledProcessError:
1709+
if '--no-mac-metadata' in tar_cmd:
1710+
tar_cmd.remove('--no-mac-metadata')
1711+
subprocess.check_call(tar_cmd, cwd=root_dir,
1712+
stdout=subprocess.DEVNULL)
1713+
else:
1714+
raise
17061715

17071716
self.assertTrue(os.path.isfile(tarball2))
17081717
# let's compare both tarballs

0 commit comments

Comments
 (0)