Skip to content

Commit ed7c5ea

Browse files
committed
fix(tests): dispatch queue test should drain the queue
1 parent 146c015 commit ed7c5ea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

queue/src/test/java/io/kestra/queue/AbstractDispatchQueueTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ void errorProcessing() throws QueueException, InterruptedException {
129129
assertThat(countDownLatch.getCount()).isEqualTo(0L);
130130
assertThat(list).hasSize(1);
131131
assertThat(list.getFirst()).isEqualTo(1);
132+
133+
// consume the remaining items from the queue
134+
CountDownLatch remaining = new CountDownLatch(3);
135+
subscriber = dispatchQueue
136+
.subscriber()
137+
.subscribe(e -> {
138+
remaining.countDown();
139+
});
140+
assertThat(remaining.await(DEFAULT_TIMEOUT_SECONDS, TimeUnit.SECONDS)).isEqualTo(true);
141+
subscriber.close();
132142
}
133143

134144
@Test

0 commit comments

Comments
 (0)