[issue27614] Race in test_docxmlrpc.py

2016-08-20 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue27614] Race in test_docxmlrpc.py

2016-08-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 397f05044172 by Martin Panter in branch '3.5': Issue #27614: Avoid race in test_docxmlrpc server setup https://hg.python.org/cpython/rev/397f05044172 New changeset 7136304ecf4c by Martin Panter in branch '2.7': Issue #27614: Avoid race in

[issue27614] Race in test_docxmlrpc.py

2016-08-11 Thread Martin Panter
Martin Panter added the comment: Thanks for the explanation. It seems a bit strange that the server thread was running so slow while the main thread did one thousand polls over at least one second. Perhaps there is a blocking DNS call hidden somewhere in it somewhere? In any case, I am pretty

[issue27614] Race in test_docxmlrpc.py

2016-08-05 Thread earl.chew
earl.chew added the comment: In the original code, the key to the failure I observed is: # wait for port to be assigned n = 1000 while n > 0 and PORT is None: time.sleep(0.001) n -= 1 This gives a fixed deadline for the server thread to create

[issue27614] Race in test_docxmlrpc.py

2016-08-05 Thread Martin Panter
Martin Panter added the comment: Earl: Can you give any more details on your original hang or race condition? Was it related to setting PORT, or shutting down the server, or something else? It is not clear from your patch. I have tried adding artificial sleep() calls at various points but

[issue27614] Race in test_docxmlrpc.py

2016-08-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have a doubt. Added a question on Rietveld. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue27614] Race in test_docxmlrpc.py

2016-08-03 Thread Martin Panter
Martin Panter added the comment: It seems the test infrastructure likes all references to thread objects to be deleted, even if they are no longer running. -- Added file: http://bugs.python.org/file44003/setup-before-thread.v2.patch ___ Python

[issue27614] Race in test_docxmlrpc.py

2016-08-03 Thread Martin Panter
Martin Panter added the comment: Here is a patch with my idea of how it should work -- keywords: +patch Added file: http://bugs.python.org/file44000/setup-before-thread.patch ___ Python tracker

[issue27614] Race in test_docxmlrpc.py

2016-07-26 Thread R. David Murray
R. David Murray added the comment: OK, that's a good point. So I don't know the answer to your question. In some cases it may be mostly that the tests are old and written when the tooling was not as good. -- ___ Python tracker

[issue27614] Race in test_docxmlrpc.py

2016-07-25 Thread Martin Panter
Martin Panter added the comment: The whole point of my suggestion was to bind and set the server socket to listing mode before starting the other thread. The socketserver constructor should do this before returning: >>> s = DocXMLRPCServer(("localhost", 0)) # Calls bind() and listen() >>>

[issue27614] Race in test_docxmlrpc.py

2016-07-25 Thread R. David Murray
R. David Murray added the comment: Because the real port number doesn't exist until the server thread starts running and binds the socket using port number 0. -- nosy: +r.david.murray ___ Python tracker

[issue27614] Race in test_docxmlrpc.py

2016-07-25 Thread Martin Panter
Martin Panter added the comment: I don’t understand why we have so many tests that assign the server port in the server thread, and then use some sort of synchronization to get it to the client thread. IMO it would be simpler in this case to do something like: def setUp(self): serv =

[issue27614] Race in test_docxmlrpc.py

2016-07-25 Thread earl.chew
New submission from earl.chew: The test test_docxmlrpc.py will sometimes hang because of a timing race. I've verified that this code is the same up to version 3.5 and master at https://github.com/python/cpython/blob/master/Lib/test/test_docxmlrpc.py A proposed patch is attached. --