From b75226914d67127faa2dab166ddf7b3a5b9c7fc5 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Mon, 15 Oct 2018 08:19:23 -0400 Subject: [PATCH] Fix intermittent test failure --- .../provider/r4/ResourceProviderSummaryModeR4Test.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderSummaryModeR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderSummaryModeR4Test.java index 2d9631a9f40..1fa11c9cbfd 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderSummaryModeR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderSummaryModeR4Test.java @@ -1,8 +1,11 @@ package ca.uhn.fhir.jpa.provider.r4; +import ca.uhn.fhir.jpa.config.TestR4Config; +import ca.uhn.fhir.jpa.dao.DaoConfig; import ca.uhn.fhir.jpa.search.SearchCoordinatorSvcImpl; import ca.uhn.fhir.rest.api.SummaryEnum; import ca.uhn.fhir.util.TestUtil; +import com.google.common.collect.Lists; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Narrative; import org.hl7.fhir.r4.model.Patient; @@ -11,6 +14,8 @@ import org.junit.AfterClass; import org.junit.Test; import org.springframework.test.util.AopTestUtils; +import java.util.ArrayList; + import static org.junit.Assert.assertEquals; @SuppressWarnings("Duplicates") @@ -26,6 +31,7 @@ public class ResourceProviderSummaryModeR4Test extends BaseResourceProviderR4Tes myDaoConfig.setCountSearchResultsUpTo(null); mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(null); mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(SearchCoordinatorSvcImpl.DEFAULT_SYNC_SIZE); + myDaoConfig.setSearchPreFetchThresholds(new DaoConfig().getSearchPreFetchThresholds()); } @Override @@ -34,9 +40,11 @@ public class ResourceProviderSummaryModeR4Test extends BaseResourceProviderR4Tes myDaoConfig.setCountSearchResultsUpTo(5); mySearchCoordinatorSvcRaw = AopTestUtils.getTargetObject(mySearchCoordinatorSvc); - mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(250); + mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(50); mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(5); + myDaoConfig.setSearchPreFetchThresholds(Lists.newArrayList(20, 50, -1)); + runInTransaction(() -> { for (int i = 0; i < 104; i++) { Patient p = new Patient();