github-api
github-api copied to clipboard
Ban use of `Thread.sleep()` in tests unless specifically approved
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.