2024-03-13 00:53:08 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
|
|
|
|
Date: Tue, 5 Mar 2024 19:33:33 +0100
|
|
|
|
Subject: [PATCH] tests: Fix unit tests with high parallelism
|
|
|
|
|
|
|
|
On Arch's shiny new 48-core/96-thread build server, the
|
|
|
|
`test_install_log_content` test fails because of an unexpected
|
|
|
|
`invalid-symlink.txt` file. Apparently the test runs in parallel with
|
|
|
|
`test_install_subdir_symlinks`, which modifies the `59 install subdir`
|
|
|
|
source directory.
|
|
|
|
|
|
|
|
To fix this, make `install_subdir_invalid_symlinks` copy the entire test
|
|
|
|
into a tmpdir before modifying it.
|
|
|
|
---
|
2024-03-14 04:02:45 +00:00
|
|
|
unittests/linuxliketests.py | 21 +++++++++------------
|
|
|
|
1 file changed, 9 insertions(+), 12 deletions(-)
|
2024-03-13 00:53:08 +00:00
|
|
|
|
|
|
|
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py
|
2024-03-14 04:02:45 +00:00
|
|
|
index f66dc9769a8f..ce4d36fe024c 100644
|
2024-03-13 00:53:08 +00:00
|
|
|
--- a/unittests/linuxliketests.py
|
|
|
|
+++ b/unittests/linuxliketests.py
|
2024-03-14 04:02:45 +00:00
|
|
|
@@ -1413,25 +1413,22 @@ class LinuxlikeTests(BasePlatformTests):
|
2024-03-13 00:53:08 +00:00
|
|
|
Test that installation of broken symlinks works fine.
|
|
|
|
https://github.com/mesonbuild/meson/issues/3914
|
|
|
|
'''
|
|
|
|
- testdir = os.path.join(self.common_test_dir, testdir)
|
2024-03-14 04:02:45 +00:00
|
|
|
+ testdir = self.copy_srcdir(os.path.join(self.common_test_dir, testdir))
|
|
|
|
subdir = os.path.join(testdir, subdir_path)
|
|
|
|
with chdir(subdir):
|
|
|
|
# Can't distribute broken symlinks in the source tree because it breaks
|
|
|
|
# the creation of zipapps. Create it dynamically and run the test by
|
|
|
|
# hand.
|
|
|
|
src = '../../nonexistent.txt'
|
|
|
|
os.symlink(src, 'invalid-symlink.txt')
|
2024-03-13 00:53:08 +00:00
|
|
|
- try:
|
|
|
|
- self.init(testdir)
|
|
|
|
- self.build()
|
|
|
|
- self.install()
|
|
|
|
- install_path = subdir_path.split(os.path.sep)[-1]
|
|
|
|
- link = os.path.join(self.installdir, 'usr', 'share', install_path, 'invalid-symlink.txt')
|
|
|
|
- self.assertTrue(os.path.islink(link), msg=link)
|
|
|
|
- self.assertEqual(src, os.readlink(link))
|
|
|
|
- self.assertFalse(os.path.isfile(link), msg=link)
|
|
|
|
- finally:
|
|
|
|
- os.remove(os.path.join(subdir, 'invalid-symlink.txt'))
|
2024-03-14 04:02:45 +00:00
|
|
|
+ self.init(testdir)
|
2024-03-13 00:53:08 +00:00
|
|
|
+ self.build()
|
|
|
|
+ self.install()
|
|
|
|
+ install_path = subdir_path.split(os.path.sep)[-1]
|
2024-03-14 04:02:45 +00:00
|
|
|
+ link = os.path.join(self.installdir, 'usr', 'share', install_path, 'invalid-symlink.txt')
|
2024-03-13 00:53:08 +00:00
|
|
|
+ self.assertTrue(os.path.islink(link), msg=link)
|
|
|
|
+ self.assertEqual(src, os.readlink(link))
|
|
|
|
+ self.assertFalse(os.path.isfile(link), msg=link)
|
|
|
|
|
|
|
|
def test_install_subdir_symlinks(self):
|
|
|
|
self.install_subdir_invalid_symlinks('59 install subdir', os.path.join('sub', 'sub1'))
|