Fixed physics tests on linux (#5579)
* Fixed physics tests on linux * Fixed unit tests because of new implementation * Fixed bug in lock, fixed unit tests Co-authored-by: aljanru <aljanru@uc5564ff5a5ee55.ant.amazon.com>
This commit is contained in:
@@ -219,7 +219,8 @@ def unlock_file(file_name):
|
||||
:return: True if unlock succeeded, else False
|
||||
"""
|
||||
if not os.access(file_name, os.W_OK):
|
||||
os.chmod(file_name, stat.S_IWRITE)
|
||||
file_stat = os.stat(file_name)
|
||||
os.chmod(file_name, file_stat.st_mode | stat.S_IWRITE)
|
||||
logger.warning(f'Clearing write lock for file {file_name}.')
|
||||
return True
|
||||
else:
|
||||
@@ -235,7 +236,8 @@ def lock_file(file_name):
|
||||
:return: True if lock succeeded, else False
|
||||
"""
|
||||
if os.access(file_name, os.W_OK):
|
||||
os.chmod(file_name, stat.S_IREAD)
|
||||
file_stat = os.stat(file_name)
|
||||
os.chmod(file_name, file_stat.st_mode & (~stat.S_IWRITE))
|
||||
logger.warning(f'Write locking file {file_name}')
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user