On Fri, Apr 24, 2009 at 02:06:11PM -0700, Istvan Albert wrote:
-> On Apr 24, 4:09?pm, "C. Titus Brown" <c...@msu.edu> wrote:
-> 
-> > that you then have to figure out how to communicate that socket # back
-> > from the subprocess to the call program; I usually do that via a
-> 
-> luckily in our case we pass the port number to the server in the
-> subprocess call as the --port flag so all we need is to generate a new
-> port number rather than using a fixed one.

Alas, it's not that easy -- if you do a socket.bind(('', 0)) in the test
runner, then that socket won't be free any more!  And I don't know of
any good cross-platform way to guarantee quick socket unbinding.  So I
think you need to do the binding in the pygrdata_server.py and
communicate it back to the test runner.

I went in and made the required changes to the test suite, which also
necessitated a change in coordinator.py.  You can see the results on the
'xmlrpc_random_port' branch,

        http://github.com/ctb/pygr/commits/xmlrpc_random_port

Note that 'coordinator.get_server' used a bit of a hack to try to find a
free port; I changed it to use the random port binding trick, and then
return the bound port.  I think this is simpler, plus, it gives you a
way to guarantee that the server binding works!

   http://github.com/ctb/pygr/commit/9cca4c487c84aa1b90b8c4802072d453b62e9627

The changes to the test code were kept separate:

   http://github.com/ctb/pygr/commit/8b9bd9e77d59f1b114d22f7c57d2a5492c2de889

and they work for me.  Once we iron out any wrinkles, I expect this to
make the XML-RPC test code much more robust...

I'd appreciate any comments.

cheers,
--titus
-- 
C. Titus Brown, c...@msu.edu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to pygr-dev@googlegroups.com
To unsubscribe from this group, send email to 
pygr-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to