Skip to content

Commit

Permalink
Try to fix an intermittent test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed Oct 17, 2018
1 parent 99cd4ce commit de76f37
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -13,6 +13,7 @@
import ca.uhn.fhir.rest.param.TokenParam;
import ca.uhn.fhir.util.TestUtil;
import com.google.common.collect.Sets;
import org.hl7.fhir.instance.model.api.IAnyResource;
import org.hl7.fhir.r4.model.Patient;
import org.junit.After;
import org.junit.AfterClass;
Expand All @@ -24,6 +25,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

Expand Down Expand Up @@ -493,6 +495,7 @@ public void testFetchSecondBatchInManyThreads() throws Throwable {
* 20 should be prefetched since that's the initial page size
*/

waitForSize(20, () -> runInTransaction(()-> mySearchEntityDao.findByUuid(uuid).getNumFound()));
runInTransaction(() -> {
Search search = mySearchEntityDao.findByUuid(uuid);
assertEquals(20, search.getNumFound());
Expand Down Expand Up @@ -545,7 +548,7 @@ public void testSearchThatOnlyReturnsASmallResult() {

SearchParameterMap params = new SearchParameterMap();
params.setSort(new SortSpec(Patient.SP_NAME));
params.add(Patient.SP_RES_ID, new TokenParam("PT00000"));
params.add(IAnyResource.SP_RES_ID, new TokenParam("PT00000"));
IBundleProvider results = myPatientDao.search(params);
String uuid = results.getUuid();
ourLog.info("** Search returned UUID: {}", uuid);
Expand Down

0 comments on commit de76f37

Please sign in to comment.