Skip to content

Commit f6a5da2

Browse files
committed
debug: execute in message thread
1 parent dffdc51 commit f6a5da2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,14 @@ public void reset() throws Exception {
138138
// This resets the interrupted flag, allowing use to await the executors.
139139
Thread.interrupted();
140140

141+
boolean terminated;
141142
backgroundThread.shutdownNow();
142-
backgroundThread.awaitTermination(10, TimeUnit.SECONDS);
143+
terminated = backgroundThread.awaitTermination(10, TimeUnit.SECONDS);
144+
assert terminated : "backgroundThread not terminated";
143145

144146
eventThread.shutdownNow();
145-
eventThread.awaitTermination(10, TimeUnit.SECONDS);
147+
terminated = eventThread.awaitTermination(10, TimeUnit.SECONDS);
148+
assert terminated : "eventThread not terminated";
146149

147150
REQUEST_QUEUE.clear();
148151

@@ -185,7 +188,7 @@ public void test_sendOneBatch() throws Exception {
185188
Assertions.assertThat(tasks)
186189
.extracting(TaskHandle::isAcked).allMatch(CompletableFuture::isDone);
187190

188-
out.emitEvent(new Event.Results(received, Collections.emptyMap())).get();
191+
out.stream.onNext(new Event.Results(received, Collections.emptyMap()));
189192

190193
// Since MockServer runs in the same thread as this test,
191194
// the context will be updated before the last emitEvent returns.

0 commit comments

Comments
 (0)