8000 sleep in "test threadpool with async" is non-deterministic · Issue #715 · luvit/luv · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sleep in "test threadpool with async" is non-deterministic #715

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

Open
jamessan opened this issue Aug 31, 2024 · 1 comment
Open

sleep in "test threadpool with async" is non-deterministic #715

jamessan opened this issue Aug 31, 2024 · 1 comment

Comments

@jamessan
Copy link
Contributor

Debian's CI for arm64 has recently started failing this test more often than not.

I increased the sleep to 100 and some local tests show that to be more reliable, but it would be better if there were a deterministic way to know when the async callback has been run.

I was thinking of a semaphore, but I noticed that uv API doesn't appear to be exposed in luv. Open to ideas, but for now I'll probably patch the test to use a longer sleep.

@truemedian
Copy link
Member

With #774 merged using a semaphore to synchronize thread tests is now fair game.

jamessan added a commit to jamessan/luv that referenced this issue May 18, 2025
…en async work is done

On slow / busy systems, it may take longer than 10ms for the async
callback to run. When this happens, the test process typically crashes
since the async context has already been freed by the time it finally
gets scheduled to run.

Using a semaphore ensures the work is done before continuing through the
test.

Closes: luvit#715
jamessan added a commit to jamessan/luv that referenced this issue May 18, 2025
…en async work is done

On slow / busy systems, it may take longer than 10ms for the async
callback to run. When this happens, the test process typically crashes
since the async context has already been freed by the time it finally
gets scheduled to run.

Using a semaphore ensures the work is done before continuing through the
test.

Closes: luvit#715
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants
0