Skip to content

Commit 7bf805d

Browse files
committed
test(batch): reset interrupted flag before shutting down executors
1 parent a8b8ede commit 7bf805d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/test/java/io/weaviate/client6/v1/api/collections/batch/BatchContextTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,14 @@ public void reset() throws Exception {
124124
in = null;
125125
out = null;
126126

127+
// This resets the interrupted flag, allowing use to await the executors.
128+
Thread.interrupted();
129+
127130
backgroundThread.shutdownNow();
131+
backgroundThread.awaitTermination(10, TimeUnit.SECONDS);
132+
128133
eventThread.shutdownNow();
134+
eventThread.awaitTermination(10, TimeUnit.SECONDS);
129135

130136
REQUEST_QUEUE.clear();
131137
}
@@ -428,7 +434,6 @@ public void test_maxReconnectRetries() throws Exception {
428434
}
429435

430436
out.hangup();
431-
432437
Assertions.assertThatThrownBy(this::closeContext)
433438
.isInstanceOf(IOException.class)
434439
.hasMessageContaining("Server unavailable");

0 commit comments

Comments
 (0)