You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vasily Zakharov (JIRA)" <ji...@apache.org> on 2006/12/06 02:21:22 UTC

[jira] Commented: (HARMONY-2338) [classlib][luni] tests.api.java.net.ServerSocketTest failed intermittently

    [ http://issues.apache.org/jira/browse/HARMONY-2338?page=comments#action_12455836 ] 
            
Vasily Zakharov commented on HARMONY-2338:
------------------------------------------

I've investigated this issue a bit.

Most test cases use tests.support.Support_PortManager.getNextPort() method to generate the "random" port numbers from 6000 to 65535. However, some ports are occupied by other applications, and when getNextPort() provides some test case with an occupied port number, that test case fails.

Possible ways to resolve the problem are:

1. "Check" each port number for availability at the start of each test case.

1.1. For example, by creating ServerSocket with some "well known" parameters and making sure no exception occurs.

1.2. Another way may be creating a Socket to that port and making sure the connection fails.

2. Change the port numbers range to exclude the occupied ports. Not a good solution, of course.

3. Use fixed port numbers instead of "random" ones. This is more reliable, but also not very good, and also limits the "coverage".

4. Do not treat a BindException as a test fail, and try another port instead, may be 3 times or so.

I'm not a java.net developer, so I'm not sure which way is good and which is not, so suggestions would be appreciated.


> [classlib][luni] tests.api.java.net.ServerSocketTest failed intermittently
> --------------------------------------------------------------------------
>
>                 Key: HARMONY-2338
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2338
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: SuSE 9 ia32 multi-processor
>            Reporter: Alexei Fedotov
>
> The test failed 2 times from 162 on DRLVM r479662. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira