This is an automated email from the ASF dual-hosted git repository. johnnyv pushed a commit to branch 2.1.X in repository https://gitbox.apache.org/repos/asf/mina.git
The following commit(s) were added to refs/heads/2.1.X by this push: new dfd80f1 workout for failing unit test dfd80f1 is described below commit dfd80f1985878d9c710ea32c29367bd1aecb290a Author: Jonathan Valliere <john...@apache.org> AuthorDate: Mon Oct 4 13:43:58 2021 -0400 workout for failing unit test --- .../java/org/apache/mina/transport/AbstractBindTest.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mina-core/src/test/java/org/apache/mina/transport/AbstractBindTest.java b/mina-core/src/test/java/org/apache/mina/transport/AbstractBindTest.java index 938c134..e43e94c 100644 --- a/mina-core/src/test/java/org/apache/mina/transport/AbstractBindTest.java +++ b/mina-core/src/test/java/org/apache/mina/transport/AbstractBindTest.java @@ -43,6 +43,7 @@ import org.apache.mina.transport.socket.SocketAcceptor; import org.apache.mina.transport.socket.SocketSessionConfig; import org.apache.mina.util.AvailablePortFinder; import org.junit.After; +import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; @@ -156,13 +157,18 @@ public abstract class AbstractBindTest { } @Test - public void testManyTimes() throws IOException { + public void testManyTimes() throws IOException, InterruptedException { bind(true); - for (int i = 0; i < 1024; i++) { - acceptor.unbind(); - acceptor.bind(); - } + for (int i = 0; i < 1024; i++) { + Assert.assertTrue("Bound addresses is empty", acceptor.getLocalAddresses().size() > 0); + acceptor.unbind(); + Thread.sleep(1); + Assert.assertTrue("Bound addresses is not empty", acceptor.getLocalAddresses().size() == 0); + acceptor.bind(); + } + + acceptor.unbind(); } @Test