New submission from Charles-François Natali:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%203.x/builds/5901/steps/test/logs/stdio

"""
[134/387/1] test_signal
Timeout (1:00:00)!
Thread 0x0000000801e24800 (most recent call first):
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/socketserver.py", line 
155 in _eintr_retry
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/socketserver.py", line 
237 in serve_forever
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/threading.py", 
line 869 in run
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/threading.py", 
line 921 in _bootstrap_inner
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/threading.py", 
line 889 in _bootstrap

Thread 0x0000000801407400 (most recent call first):
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_signal.py", 
line 529 in test_itimer_real
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/unittest/case.py", 
line 571 in run
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/unittest/case.py", 
line 610 in __call__
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/unittest/suite.py", 
line 117 in run
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/unittest/suite.py", 
line 79 in __call__
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/unittest/suite.py", 
line 117 in run
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/unittest/suite.py", 
line 79 in __call__
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/unittest/runner.py", 
line 168 in run
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/support/__init__.py",
 line 1685 in _run_suite
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/support/__init__.py",
 line 1719 in run_unittest
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_signal.py", 
line 934 in test_main
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/regrtest.py", 
line 1278 in runtest_inner
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/regrtest.py", 
line 967 in runtest
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/regrtest.py", 
line 763 in main
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/regrtest.py", 
line 1562 in main_in_temp_cwd
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/__main__.py", 
line 3 in <module>
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/runpy.py", line 
73 in _run_code
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/runpy.py", line 
160 in _run_module_as_main
*** Error code 1
"""

test_signal hangs, but that's because there's a dangling socketserver thread 
running from a failed test_imaplib test earlier in the test run:
"""
======================================================================
ERROR: test_login_cram_md5 (test.test_imaplib.ThreadedNetworkedTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/imaplib.py", 
line 940, in _command
    self.send(CRLF)
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/imaplib.py", 
line 276, in send
    self.sock.sendall(data)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_imaplib.py", 
line 216, in reaped_pair
    yield server, client
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_imaplib.py", 
line 319, in test_login_cram_md5
    ret, data = client.login_cram_md5("tim", "tanstaaftanstaaf")
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/imaplib.py", 
line 549, in login_cram_md5
    return self.authenticate('CRAM-MD5', self._CRAM_MD5_AUTH)
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/imaplib.py", 
line 380, in authenticate
    typ, dat = self._simple_command('AUTHENTICATE', mech)
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/imaplib.py", 
line 1127, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/imaplib.py", 
line 942, in _command
    raise self.abort('socket error: %s' % val)
imaplib.abort: socket error: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/support/__init__.py",
 line 1831, in decorator
    return func(*args)
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_imaplib.py", 
line 320, in test_login_cram_md5
    self.assertEqual(ret, "OK")
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/contextlib.py", 
line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File 
"/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_imaplib.py", 
line 218, in reaped_pair
    client.logout()
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/imaplib.py", 
line 570, in logout
    self.shutdown()
  File "/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/imaplib.py", 
line 283, in shutdown
    self.sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [Errno 54] Connection reset by peer
"""

Here's the code in charge of stopping the client and server:
"""
    def reaped_pair(self, hdlr):
        server, thread = self.make_server((support.HOST, 0), hdlr)
        client = self.imap_class(*server.server_address)
        try:
            yield server, client
        finally:
            client.logout()
            self.reap_server(server, thread)
"""

But if client.logout() raises and exception - as is the case above - 
reap_server() is never called.

----------
components: Tests
messages: 204967
nosy: neologix
priority: normal
severity: normal
stage: needs patch
status: open
title: test_imaplib doesn't always reap SocketServer thread
type: behavior
versions: Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19857>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to