Skip to content

Commit dcb9b05

Browse files
committed
use always a new thread for the tck verification as the TCK uses thread locals to track things, which can cause tests failure in rare cases
1 parent cb65b70 commit dcb9b05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/groovy/graphql/execution/reactive/tck/CompletionStageMappingPublisherTckVerificationTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.time.Duration;
1111
import java.util.concurrent.CompletableFuture;
1212
import java.util.concurrent.CompletionStage;
13+
import java.util.concurrent.Executors;
1314
import java.util.function.Function;
1415

1516
/**
@@ -31,7 +32,7 @@ public long maxElementsFromPublisher() {
3132
@Override
3233
public Publisher<String> createPublisher(long elements) {
3334
Publisher<Integer> publisher = Flowable.range(0, (int) elements);
34-
Function<Integer, CompletionStage<String>> mapper = i -> CompletableFuture.supplyAsync(() -> i + "!");
35+
Function<Integer, CompletionStage<String>> mapper = i -> CompletableFuture.supplyAsync(() -> i + "!", Executors.newSingleThreadExecutor());
3536
return new CompletionStageMappingPublisher<>(publisher, mapper);
3637
}
3738

0 commit comments

Comments
 (0)