fix(synology): await producer thread shutdown before returning from uploadVideoChunks - #1494
fix(synology): await producer thread shutdown before returning from uploadVideoChunks#1494alexeyqu wants to merge 1 commit into
Conversation
|
The added According to the Suggested fix} finally {
consumerAborted.set(true);
try {
producerFuture.get(5, TimeUnit.SECONDS);
} catch (Exception ignored) {
// Expected: CancellationException if cancelled, or timeout -- producer is stopping
}
producerFuture.cancel(true);
} |
|
@simonxander thank you! However, this PR didn't fix the flaky test. After some discovery around #1495 I found the issue is test JVM OOM-ing during the test suite for Synology. #1498 is the proposed temporary fix to unblock the CI -- and kickstart the conversation around a more permanent fix. This PR is no longer needed, closing. |
producerFuture.cancel(true)requests interruption but returns immediately, leaving the producer thread alive aftercreateVideoreturns. On resource-constrained CI runners, this races with Mockito's post-test stub validation, causingCreateMediaVideoModel tests to flake as SKIPPED.Added
producerFuture.get(5, TimeUnit.SECONDS)after the cancel so the method only returns once the producer has actually stopped.CancellationExceptionand timeout are swallowed -- both mean the producer is done or on its way out.Fixes the flaky test (see Gradle CI attempts on current master branch)