>>>I run socket and select unit test on my Linux machine and got some errors.
>>Try commenting out the "TCPClientTimeoutTest" class in the test_main()
>>function at the bottom of the test_socket.py file.
> Tried that but still got 43 errors most of the time and sometimes 32
> or 35. Errors seem to be same as before and the error message is still
> "error: (98, 'Address already in use')".
Are there any known problems with reuse_address on your platform?
Every single test should be self contained, in that each opens and
closes the server socket, in setUp and tearDown respectively.
If you change the definition of the SocketTCPTest to be like this,
you'll see what I mean
self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
jsocket = self.serv._get_jsocket()
self.serv = None
It would be good to see the state of the server socket between tests, by
looking at the output of netstat.
Insert a delay or a pause in the setUp method of the class above, and
examine the state of port 50007 using netstat. If you see sockets in
TIME_WAIT or FIN_WAIT_? states, then there may be problems with the
Did you say that you're running on a dual-cpu machine? Perhaps the
threads being distributed across two cpus might be causing timing
issues. Although the test_socket module uses threading.Event's to avoid
this. Try inserting a 1-10 second time.sleep at the beginning of the
SocketTCPTest.setUp method, to see if that makes a difference.
Lastly, googling "serversocket bindexception ubuntu" yields other
1. Port number is priviledged, i.e. < 1024. I presume that you have not
changed the test port number from 50007.
2. The 'localhost' interface is not working properly.
Lastly, what JVM are you using?
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Jython-dev mailing list