@Test(timeout = 5_000)
public void testShutdown() {

    List<Disposable> disposables = new ArrayList<>();
    AtomicInteger errors = new AtomicInteger();
    for (int i = 0; i < 5; i++) {
        int index = i;
        Disposable disposable = reactorSerializedInvoker.submit(Mono.delay(Duration.ofHours(1)).map(tick -> "#" + index))
                .doFinally(signalType -> errors.incrementAndGet())
                .subscribe(
                        next -> {
                        },
                        e -> {
                        }
                );
        disposables.add(disposable);
    }
    reactorSerializedInvoker.shutdown(Duration.ofSeconds(5));
    await().until(() -> disposables.stream().map(Disposable::isDisposed).reduce(true, (a, b) -> a && b));
    assertThat(errors.get()).isEqualTo(5);
}