Skip to content

Commit

Permalink
Disable unstable test.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
berngp committed Apr 25, 2022
1 parent 96aed13 commit 8f34384
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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));
}
}

0 comments on commit 8f34384

Please sign in to comment.