From 8f34384b2aacb6ba1fcbb793f4e0080902d0086e Mon Sep 17 00:00:00 2001 From: Bernardo Gomez Palacio Date: Mon, 25 Apr 2022 11:55:59 -0700 Subject: [PATCH] Disable unstable test. The need of this test is questionable, since the concurrent execution of data fetchers is left to the graphql-java engine. We can't assume the order of execution of unrelated fields, in the case of this test `data.concurrent2` can be fetched before `data.concurrent1` or vice versa. --- .../dgs/example/shared/ConcurrentDataFetcherTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/graphql-dgs-example-shared/src/test/java/com/netflix/graphql/dgs/example/shared/ConcurrentDataFetcherTest.java b/graphql-dgs-example-shared/src/test/java/com/netflix/graphql/dgs/example/shared/ConcurrentDataFetcherTest.java index ee76b75c2..d560d503c 100644 --- a/graphql-dgs-example-shared/src/test/java/com/netflix/graphql/dgs/example/shared/ConcurrentDataFetcherTest.java +++ b/graphql-dgs-example-shared/src/test/java/com/netflix/graphql/dgs/example/shared/ConcurrentDataFetcherTest.java @@ -18,11 +18,14 @@ import com.jayway.jsonpath.DocumentContext; import com.netflix.graphql.dgs.DgsQueryExecutor; +import org.assertj.core.data.Percentage; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +@Disabled("The need of this test is questionable, since the concurrent execution of data fetchers is left to the graphql-java engine.") @ExampleSpringBootTest class ConcurrentDataFetcherTest { @@ -35,7 +38,8 @@ void concurrent() { DocumentContext documentContext = queryExecutor.executeAndGetDocumentContext("{concurrent1, concurrent2}"); int ts1 = documentContext.read("data.concurrent1"); int ts2 = documentContext.read("data.concurrent2"); - - assertThat(ts1).isGreaterThanOrEqualTo(ts2); + // you can't assume the order of execution of unrelated fields, in this case data.concurrent2 can be fetched + // before data.concurrent1 or vice versa. + assertThat(ts1).isCloseTo(ts2, Percentage.withPercentage(10.0)); } } \ No newline at end of file