Skip to content

Commit ca8f707

Browse files
committed
[test] fix flaky issue5762-user-data-dir
1 parent 36ff6ed commit ca8f707

File tree

1 file changed

+21
-2
lines changed
  • test/sanity/issue5762-user-data-dir

1 file changed

+21
-2
lines changed

test/sanity/issue5762-user-data-dir/test.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,27 @@ def copytree(src, dst, symlinks=False, ignore=None):
6969
p = subprocess.Popen([exe])
7070
time.sleep(10)
7171

72+
user_data_dir_exists = False
73+
check_file_exists = False
74+
75+
timeout = 30
76+
while timeout > 0:
77+
if os.path.exists(user_data_dir):
78+
user_data_dir_exists = True
79+
break
80+
time.sleep(1)
81+
timeout = timeout - 1
82+
83+
if user_data_dir_exists:
84+
timeout = 30
85+
while timeout > 0:
86+
if os.path.exists(check_file):
87+
check_file_exists = True
88+
break
89+
time.sleep(1)
90+
timeout = timeout - 1
7291
try:
73-
assert os.path.exists(user_data_dir)
74-
assert os.path.exists(check_file)
92+
assert user_data_dir_exists
93+
assert check_file_exists
7594
finally:
7695
p.terminate()

0 commit comments

Comments
 (0)