Skip to content
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

Ban use of Thread.sleep() in tests unless specifically approved #1815

Open
bitwiseman opened this issue Mar 11, 2024 · 0 comments
Open

Ban use of Thread.sleep() in tests unless specifically approved #1815

bitwiseman opened this issue Mar 11, 2024 · 0 comments
Labels

Comments

@bitwiseman
Copy link
Member

bitwiseman commented Mar 11, 2024

We add await-based pauses the don't slow down CI testing:

https://github.com/hub4j/github-api/blob/main/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java#L574-L584

There are some timing based tests, but they are the exception. Most tests don't need to care.
We need to make await() an easily used test helper, enforce not calling Thread.sleep() unless specifically approved, and provide a helpful failure message regarding using await.

Perhaps also a sleepWhenTakingSnapshot() method. See #1810 for example of why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant