Also made the test less flaky in GH Actions (still possible for it to take more than 10s).
Saw this in test output
Timed out waiting for queue to be empty.
Error: Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.323 s <<< FAILURE! - in com.posthog.java.PostHogTest
Error: testMaxTimeInQueue(com.posthog.java.PostHogTest) Time elapsed: 1.208 s <<< FAILURE!
Error: Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.378 s <<< FAILURE! - in com.posthog.java.PostHogTest
Error: testMaxTimeInQueue(com.posthog.java.PostHogTest) Time elapsed: 0.244 s <<< FAILURE!
So 10 ms was definitely too small wait time sadly.
Also made the test less flaky in GH Actions (still possible for it to take more than 10s).
Saw this in test output
So 10 ms was definitely too small wait time sadly.