File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/test/java/com/rabbitmq/tools Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ public static Process invokeMakeTarget(String command) throws IOException {
133133
134134 public static void startRabbitOnNode () throws IOException {
135135 rabbitmqctl ("start_app" );
136- tryConnectFor (10_000 );
136+ tryConnectFor (10 * 000 );
137137 }
138138
139139 public static void stopRabbitOnNode () throws IOException {
@@ -151,11 +151,13 @@ public static void tryConnectFor(int timeoutInMs) throws IOException {
151151 }
152152 totalWaitTime += waitTime ;
153153 ConnectionFactory connectionFactory = TestUtils .connectionFactory ();
154- try ( Connection ignored = connectionFactory . newConnection ()) {
155- return ;
156-
154+ Connection c = null ;
155+ try {
156+ c = connectionFactory . newConnection ();
157157 } catch (Exception e ) {
158158 // retrying
159+ } finally {
160+ TestUtils .close (c );
159161 }
160162 }
161163 throw new IOException ("Could not connect to broker for " + timeoutInMs + " ms" );
You can’t perform that action at this time.
0 commit comments