This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients nadeem.vawda, neologix, pitrou, python-dev, vstinner
Date 2011-12-10.13:33:18
SpamBayes Score 1.0674698e-08
Marked as misclassified No
Message-id <CAH_1eM0VkAi_KxiONm3jT9qoTczNQ8wrxiw5ahJ=05MymSsf3A@mail.gmail.com>
In-reply-to <E1RZLsl-0008Si-Ay@dinsdale.python.org>
Content
The test_poplib failures are likely due to this obvious race:

"""
    def setUp(self):
[...]
        threading.Thread(target=self.server, args=(self.evt,self.sock)).start()
        time.sleep(.1)

[...]
    def server(self, evt, serv):
        serv.listen(5)
"""

If the server thread doesn't call listen() before sleep(.1) returns,
the client will receive ECONNREFUSED (the test fail consistently
without the sleep).
The patch attached fixes this, and also does the same type of cleanup
as for test_telnetlib in #11812.
Files
File name Uploaded
fix_poplib.diff neologix, 2011-12-10.13:33:18
History
Date User Action Args
2011-12-10 13:33:45neologixsetrecipients: + neologix, pitrou, vstinner, nadeem.vawda, python-dev
2011-12-10 13:33:19neologixlinkissue13453 messages
2011-12-10 13:33:18neologixcreate