diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestDstu3Config.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestDstu3Config.java index f8d4802aee5..cdb356cea69 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestDstu3Config.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestDstu3Config.java @@ -20,6 +20,8 @@ import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor; import ca.uhn.fhir.validation.ResultSeverityEnum; import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder; +import static org.junit.Assert.fail; + @Configuration @EnableTransactionManagement() public class TestDstu3Config extends BaseJavaConfigDstu3 { @@ -46,6 +48,9 @@ public class TestDstu3Config extends BaseJavaConfigDstu3 { } catch (Exception e) { ourLog.error("Exceeded maximum wait for connection", e); logGetConnectionStackTrace(); + if ("true".equals(System.getProperty("ci"))) { + fail("Exceeded maximum wait for connection: "+ e.toString()); + } System.exit(1); retVal = null; } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java index 3a3c6eed2e9..d296e849aee 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/config/TestR4Config.java @@ -20,6 +20,8 @@ import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor; import ca.uhn.fhir.validation.ResultSeverityEnum; import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder; +import static org.junit.Assert.fail; + @Configuration @EnableTransactionManagement() public class TestR4Config extends BaseJavaConfigR4 { @@ -46,6 +48,9 @@ public class TestR4Config extends BaseJavaConfigR4 { } catch (Exception e) { ourLog.error("Exceeded maximum wait for connection", e); logGetConnectionStackTrace(); + if ("true".equals(System.getProperty("ci"))) { + fail("Exceeded maximum wait for connection: " + e.toString()); + } System.exit(1); retVal = null; }