Skip to content

Commit 047790e

Browse files
committed
Fix race in TcpOutboundGatewayTests
1 parent 7035699 commit 047790e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -377,12 +377,14 @@ public void run() {
377377
oos.writeObject(request.replace("Test", "Reply"));
378378
logger.debug("Replied to " + request);
379379
lastReceived.set(request);
380-
serverLatch.countDown();
381380
}
382381
catch (IOException e) {
383382
logger.debug("error on write " + e.getClass().getSimpleName());
384383
socket.close();
385384
}
385+
finally {
386+
serverLatch.countDown();
387+
}
386388
}
387389
}
388390
}

0 commit comments

Comments
 (0)