-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
None
The test methods in`SocketHandlerTests` are using same port. Sometimes the operating system does not release the port fast enough. Then another test method cannot reuse the port and ends with `java.net.BindException: Address already in use` exception.
This happens especially on heavy loaded system.
The `SimpleServer` implements `AutoCloseable` interface and in `close` method is used `service.awaitTermination(30, TimeUnit.SECONDS);`. So at the end of try with resource where is created `SimpleServer` java should wait 30 seconds until the operating system release used port. But when the operating system is heavy load then it return to java the port was successfully released but it didn't happened yet. It will happened few millisecond later. But In that time is started new test which try use used port and ends with exception.