Skip to content

Commit 1830fad

Browse files
authored
[LLDB] Fix write permission error in TestGlobalModuleCache.py (#76171)
TestGlobalModuleCache.py, a recently added test, tries to update a source file in the build directory, but it assumes the file is writable. In our distributed build and test system, this is not always true, so the test often fails with a write permissions error. This change fixes that by setting the permissions on the file to be writable before attempting to write to it.
1 parent 74a09bd commit 1830fad

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ def copy_to_main(self, src, dst):
2626
# a previous build, so sleep a bit here to ensure that the touch is later.
2727
time.sleep(2)
2828
try:
29+
# Make sure dst is writeable before trying to write to it.
30+
subprocess.run(
31+
["chmod", "777", dst],
32+
stdin=None,
33+
capture_output=False,
34+
encoding="utf-8",
35+
)
2936
shutil.copy(src, dst)
3037
except:
3138
self.fail(f"Could not copy {src} to {dst}")

0 commit comments

Comments
 (0)