[3.13] gh-111051: [tests] Wait a second to support filesystems with low-resolution mtime (GH-121959) (GH-122114)

(cherry picked from commit cad11a2bdc)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Miss Islington (bot) 2024-08-12 13:00:33 +02:00 committed by GitHub
parent d6d68cfd86
commit 8b64ce4eb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3416,10 +3416,12 @@ def bœr():
print("hello")
"""
# the time.sleep is needed for low-resolution filesystems like HFS+
commands = """
filename = $_frame.f_code.co_filename
f = open(filename, "w")
f.write("print('goodbye')")
import time; time.sleep(1)
f.close()
ll
"""
@ -3429,10 +3431,12 @@ def bœr():
self.assertIn("was edited", stdout)
def test_file_modified_after_execution_with_multiple_instances(self):
# the time.sleep is needed for low-resolution filesystems like HFS+
script = """
import pdb; pdb.Pdb().set_trace()
with open(__file__, "w") as f:
f.write("print('goodbye')\\n" * 5)
import time; time.sleep(1)
import pdb; pdb.Pdb().set_trace()
"""