Restored a couple of the Unit Tests in ca.uhn.fhir.jpa.stresstest.StressTestR4Test.java (#4413)

* Restored the Unit Tests in ca.uhn.fhir.jpa.stresstest.StressTestR4Test.java.

* 4412 - Disabled some long running Unit Tests.
This commit is contained in:
Kevin Dougan SmileCDR 2023-01-09 12:55:46 -05:00 committed by GitHub
parent 10615eb64c
commit 84d83f6230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 7 deletions

View File

@ -76,7 +76,6 @@ import static org.junit.jupiter.api.Assertions.fail;
"max_db_connections=10" "max_db_connections=10"
}) })
@DirtiesContext @DirtiesContext
@Disabled
public class StressTestR4Test extends BaseResourceProviderR4Test { public class StressTestR4Test extends BaseResourceProviderR4Test {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(StressTestR4Test.class); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(StressTestR4Test.class);
@ -122,6 +121,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
myPagingProvider.setMaximumPageSize(300); myPagingProvider.setMaximumPageSize(300);
} }
@Disabled
@Test @Test
public void testNoDuplicatesInSearchResults() throws Exception { public void testNoDuplicatesInSearchResults() throws Exception {
int resourceCount = 1000; int resourceCount = 1000;
@ -198,7 +198,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
assertEquals(resourceCount, ids.size()); assertEquals(resourceCount, ids.size());
} }
@Disabled
@Test @Test
public void testPageThroughLotsOfPages() { public void testPageThroughLotsOfPages() {
myDaoConfig.setIndexMissingFields(DaoConfig.IndexEnabledEnum.DISABLED); myDaoConfig.setIndexMissingFields(DaoConfig.IndexEnabledEnum.DISABLED);
@ -270,6 +270,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
assertEquals(count - 1000, Sets.newHashSet(ids).size()); assertEquals(count - 1000, Sets.newHashSet(ids).size());
} }
@Disabled
@Test @Test
public void testPageThroughLotsOfPages2() { public void testPageThroughLotsOfPages2() {
myDaoConfig.setIndexMissingFields(DaoConfig.IndexEnabledEnum.DISABLED); myDaoConfig.setIndexMissingFields(DaoConfig.IndexEnabledEnum.DISABLED);
@ -305,6 +306,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
} }
@Disabled
@Test @Test
public void testSearchWithLargeNumberOfIncludes() { public void testSearchWithLargeNumberOfIncludes() {
@ -341,7 +343,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
map.setLoadSynchronous(true); map.setLoadSynchronous(true);
IBundleProvider results = myDiagnosticReportDao.search(map, mySrd); IBundleProvider results = myDiagnosticReportDao.search(map, mySrd);
List<IBaseResource> resultsAndIncludes = results.getResources(0, 999999); List<IBaseResource> resultsAndIncludes = results.getResources(0, 999999);
assertEquals(1202, resultsAndIncludes.size()); assertEquals(1001, resultsAndIncludes.size());
// Using focused includes // Using focused includes
map = new SearchParameterMap(); map = new SearchParameterMap();
@ -350,7 +352,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
map.setLoadSynchronous(true); map.setLoadSynchronous(true);
results = myDiagnosticReportDao.search(map, mySrd); results = myDiagnosticReportDao.search(map, mySrd);
resultsAndIncludes = results.getResources(0, 999999); resultsAndIncludes = results.getResources(0, 999999);
assertEquals(1202, resultsAndIncludes.size()); assertEquals(1001, resultsAndIncludes.size());
} }
@Disabled @Disabled
@ -393,6 +395,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
} }
} }
@Disabled
@Test @Test
public void testMultithreadedSearch() throws Exception { public void testMultithreadedSearch() throws Exception {
Bundle input = new Bundle(); Bundle input = new Bundle();
@ -465,7 +468,8 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
ourLog.info("Results: {}", results); ourLog.info("Results: {}", results);
assertThat(results, not(Matchers.empty())); assertThat(results, not(Matchers.empty()));
assertThat(results.get(0), containsString("HTTP 409 Conflict: Error flushing transaction with resource types: [Patient]")); assertThat(results.get(0), containsString("HTTP 409 Conflict"));
assertThat(results.get(0), containsString("Error flushing transaction with resource types: [Patient]"));
} }
@Test @Test
@ -516,7 +520,8 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
ourLog.info("Results: {}", results); ourLog.info("Results: {}", results);
assertThat(results, not(Matchers.empty())); assertThat(results, not(Matchers.empty()));
assertThat(results.get(0), containsString("HTTP 409 Conflict: Error flushing transaction with resource types: [Patient]")); assertThat(results.get(0), containsString("HTTP 409 Conflict"));
assertThat(results.get(0), containsString("Error flushing transaction with resource types: [Patient]"));
} }
/** /**
@ -527,6 +532,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
* JpaValidationSupportDstuXX be transactional, which it should have been * JpaValidationSupportDstuXX be transactional, which it should have been
* anyhow. * anyhow.
*/ */
@Disabled
@Test @Test
public void testMultithreadedSearchWithValidation() throws Exception { public void testMultithreadedSearchWithValidation() throws Exception {
myServer.registerInterceptor(myRequestValidatingInterceptor); myServer.registerInterceptor(myRequestValidatingInterceptor);
@ -565,6 +571,7 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
validateNoErrors(tasks); validateNoErrors(tasks);
} }
@Disabled
@Test @Test
public void test_DeleteExpunge_withLargeBatchSizeManyResources() { public void test_DeleteExpunge_withLargeBatchSizeManyResources() {
// setup // setup
@ -603,9 +610,10 @@ public class StressTestR4Test extends BaseResourceProviderR4Test {
int deleteCount = myCaptureQueriesListener.getDeleteQueries().size(); int deleteCount = myCaptureQueriesListener.getDeleteQueries().size();
myCaptureQueriesListener.logDeleteQueries(); myCaptureQueriesListener.logDeleteQueries();
assertThat(deleteCount, is(equalTo(88))); assertThat(deleteCount, is(equalTo(59)));
} }
@Disabled
@Test @Test
public void testDeleteExpungeOperationOverLargeDataset() { public void testDeleteExpungeOperationOverLargeDataset() {
myDaoConfig.setAllowMultipleDelete(true); myDaoConfig.setAllowMultipleDelete(true);