From 2e74ad72cb55d20874366b1a19f53eecf134f88a Mon Sep 17 00:00:00 2001 From: James Agnew Date: Wed, 23 May 2018 08:52:24 -0400 Subject: [PATCH] Improve timeouts on test ports --- hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PortUtil.java | 1 + .../ca/uhn/fhir/rest/server/OperationServerHl7OrgTest.java | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PortUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PortUtil.java index b4f8f4bbe97..93e78db922d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PortUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/PortUtil.java @@ -46,6 +46,7 @@ public class PortUtil { int port; do { server = new ServerSocket(0); + server.setReuseAddress(true); port = server.getLocalPort(); server.close(); } while (!ourPorts.add(port)); diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/OperationServerHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/OperationServerHl7OrgTest.java index 13c956e3945..d397d67c1d2 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/OperationServerHl7OrgTest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/OperationServerHl7OrgTest.java @@ -32,9 +32,6 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.util.PortUtil; -/** - * Created by dsotnikov on 2/25/2014. - */ public class OperationServerHl7OrgTest { private static CloseableHttpClient ourClient; private static FhirContext ourCtx;