Skip to content

Commit af93338

Browse files
committed
up
1 parent 755fc4e commit af93338

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,16 @@ def assert_ldd_version_container(container: Container, version: str) -> None:
206206

207207

208208
def snapshot_pid_profile(profiler: ProfilerInterface, pid: int) -> ProfileData:
209-
last_snapshot = None
209+
last_snapshot = profiler.snapshot()
210210

211211
def has_profile() -> bool:
212212
nonlocal last_snapshot
213+
if pid in last_snapshot:
214+
return True
213215
last_snapshot = profiler.snapshot()
214216
return pid in last_snapshot
215217

216-
wait_event(timeout=5, stop_event=Event(), condition=has_profile, interval=1)
218+
wait_event(timeout=5, stop_event=Event(), condition=has_profile, interval=0.1)
217219
return last_snapshot[pid] # type: ignore
218220

219221

0 commit comments

Comments
 (0)