-
-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure test_watch_requires_lock_to_run
to avoid flakes
#6469
Conversation
) | ||
thread.daemon = True | ||
thread.start() | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of
distributed/distributed/tests/test_profile.py
Lines 238 to 241 in 8c049b8
start = time() # wait until thread starts up | |
while threading.active_count() < start_threads + 2: | |
assert time() < start + 2 | |
sleep(0.01) |
test_watch
, so I'll adjust both of them for more reliable behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.py
fails occasionally (e.g., see #6444 (comment)). This test restructures the test to avoid timing-based flakes.Closes #xxxx
pre-commit run --all-files