harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Regis <xu.re...@gmail.com>
Subject [classlib][luni] ServerSocketTest.test_setReuseAddressZ() faild on Linux
Date Fri, 23 Jan 2009 11:44:27 GMT
did anyone notice the failures on linux? or it just happen on my local env?
junit.framework.AssertionFailedError: Unexpected exception when 
setReuseAddress is the default case and we 
bind:Harmony-L3NEK37/127.0.0.1:55891:java.net.BindException: The address 
is not available
at junit.framework.Assert.fail(Assert.java:47)
at 
org.apache.harmony.luni.tests.java.net.ServerSocketTest.test_setReuseAddressZ(ServerSocketTest.java:760)
at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
at java.lang.reflect.Method.invoke(Method.java:317)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

I found the default value of ServerSocket.getReuseAddress() on Linux 
should be true, but on Harmony is false, following simple test show this:

ServerSocket serverSocket = new ServerSocket();
System.out.println(serverSocket.getReuseAddress());

and I found it's introduced by commit r723103, and the code set default 
value is removed intended, so I think there must be a reason. From spec, 
it's undefined:
When a ServerSocket is created the initial setting of SO_REUSEADDR is 
not defined

So both Harmony and RI are reasonable.

Should we follow RI or mark it as non-bug difference and correct the 
test case?

-- 
Best Regards,
Regis.

Mime
View raw message