Skip to content

Commit b4f1d4b

Browse files
committed
make test stable
1 parent 860a0bd commit b4f1d4b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/test/groovy/graphql/execution/instrumentation/dataloader/DeferWithDataLoaderTest.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,13 @@ class DeferWithDataLoaderTest extends Specification {
374374
combined.errors == null
375375
combined.data == expectedExpensiveData
376376

377-
batchCompareDataFetchers.departmentsForShopsBatchLoaderCounter.get() == (contextKey != ENABLE_DATA_LOADER_EXHAUSTED_DISPATCHING ? 1 : 2)
377+
if (contextKey == ENABLE_DATA_LOADER_EXHAUSTED_DISPATCHING) {
378+
// based on the timing of shops vs expensiveShops DF it could be one or two batch loader calls
379+
batchCompareDataFetchers.departmentsForShopsBatchLoaderCounter.get() == 1 || batchCompareDataFetchers.departmentsForShopsBatchLoaderCounter.get() == 2
380+
} else {
381+
batchCompareDataFetchers.departmentsForShopsBatchLoaderCounter.get() == 1
382+
383+
}
378384
batchCompareDataFetchers.productsForDepartmentsBatchLoaderCounter.get() == 1
379385

380386
where:

0 commit comments

Comments
 (0)