Restructure test_watch_requires_lock_to_run to avoid flakes#6469
Restructure test_watch_requires_lock_to_run to avoid flakes#6469
test_watch_requires_lock_to_run to avoid flakes#6469Conversation
| log = watch(interval="10ms", cycle="50ms", stop=stop_profile) | ||
| log = watch(interval="10ms", cycle="50ms", stop=stop_profiling) | ||
|
|
||
| start = time() # wait until thread starts up |
There was a problem hiding this comment.
how about using an event to wait for the profiler thread to start, and grabbing the profile_thread in a nonlocal?
stop_profiling_called = threading.Event()
profile_thread = None
def stop_profiling():
nonlocal profile_thread
profile_thread = threading.current_thread()
stop_profiling_called.set()
return time() > start + 0.500
stop_profiling_called.wait(2)
sleep(0.5)
assert len(log) == 0
release_lock = True
profile_thread.join(2)
thread.join(2)There was a problem hiding this comment.
Instead of
distributed/distributed/tests/test_profile.py
Lines 238 to 241 in 8c049b8
test_watch, so I'll adjust both of them for more reliable behavior.
There was a problem hiding this comment.
Done, adjusted the structure to be more event-based.
Unit Test Results 15 files ± 0 15 suites ±0 5h 43m 1s ⏱️ - 50m 6s For more details on these failures, see this check. Results for commit 06500d4. ± Comparison against base commit 1346671. ♻️ This comment has been updated with latest results. |
|
Failures are unrelated. |
|
@graingert do you approve (I'm not reviewing this closely) |
) distributed/tests/test_profile.py fails occasionally (e.g., see dask#6444 (comment)). This test restructures the test to avoid timing-based flakes.
distributed/tests/test_profile.pyfails occasionally (e.g., see #6444 (comment)). This test restructures the test to avoid timing-based flakes.Closes #xxxx
pre-commit run --all-files