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.

classification
Title: test_logging fails
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: flox, pitrou, vinay.sajip
Priority: normal Keywords: buildbot

Created on 2010-02-05 13:58 by pitrou, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (8)
msg98872 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-02-05 13:58
First, listening and/or connecting often fails.
Second, the test should use try/finally to release all resources even in case of failure.

This is breaking most buildbots currently: http://www.python.org/dev/buildbot/trunk/


[snip]
test_listen_config_1_ok (test.test_logging.ConfigDictTest) ... Exception in thread Thread-1044:
Traceback (most recent call last):
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/threading.py", line 526, in __bootstrap_inner
    self.run()
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/threading.py", line 479, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/logging/config.py", line 847, in serve
    server = rcvr(port=port, handler=hdlr)
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/logging/config.py", line 827, in __init__
    ThreadingTCPServer.__init__(self, (host, port), handler)
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/SocketServer.py", line 406, in __init__
    self.server_bind()
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/SocketServer.py", line 417, in server_bind
    self.socket.bind(self.server_address)
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/socket.py", line 222, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use

ok

======================================================================
ERROR: test_listen_config_10_ok (test.test_logging.ConfigDictTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_logging.py", line 1597, in test_listen_config_10_ok
    self.setup_via_listener(json.dumps(self.config10))
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_logging.py", line 1581, in setup_via_listener
    sock.connect(('localhost', PORT))
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/socket.py", line 222, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused
msg98873 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-05 14:14
It could take benefit of "test_support.find_unused_port".
msg98876 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-02-05 14:54
Fix checked into trunk with following changes:
  - use of test_support.find_unused_port()
  - if connection is refused, a finally clause shuts down the server thread.

Marked as pending awaiting testing of these changes on buildbots.
msg98877 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-02-05 15:56
Further update done to disable listening tests for now (r77986). Will try to investigate these - the trouble is, they work on my system :-(
msg98878 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-05 16:02
You may use the decorator @unittest.skip("see issue #7857") for these tests, until it's fixed.
(or @unittest.expectedFailure, if you want to run them anyway)

http://docs.python.org/dev/library/unittest.html#unittest.skip
msg98975 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-02-07 01:10
Tests now seem to be fine. Thanks, Benjamin Peterson, for the fix.
msg99045 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-02-08 13:00
There are still random failures:

test test_logging failed -- Traceback (most recent call last):
  File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_logging.py", line 1612, in test_listen_config_10_ok
    ], stream=output)
  File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_logging.py", line 116, in assert_log_lines
    self.assertEquals(len(actual_lines), len(expected_values))
AssertionError: 0 != 2

See http://www.python.org/dev/buildbot/trunk/builders/sparc%20solaris10%20gcc%20trunk/builds/348
msg99046 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-02-08 15:21
----- Original Message ----

> From: Antoine Pitrou <report@bugs.python..org>
> 
> There are still random failures:
> 

Ouch. I'm not sure that I can debug this quickly, because the tests work on all platforms I've got access to (Windows XP, Linux Jaunty) and even where they fail, the verbose re-test often succeeds. Perhaps I should just re-enable skipping of those tests for now to avoid problems on the buildbots, and see if I can get a reproducible error on the systems I have access to.

Any suggestions gratefully received :-)
History
Date User Action Args
2022-04-11 14:56:57adminsetgithub: 52105
2010-02-08 15:21:25vinay.sajipsetmessages: + msg99046
2010-02-08 13:00:42pitrousetmessages: + msg99045
2010-02-07 01:10:05vinay.sajipsetstatus: open -> closed

messages: + msg98975
2010-02-06 13:11:16vinay.sajipsetpriority: critical -> normal
2010-02-05 16:02:14floxsetmessages: + msg98878
2010-02-05 15:56:28vinay.sajipsetstatus: pending -> open

messages: + msg98877
2010-02-05 14:54:14vinay.sajipsetstatus: open -> pending
resolution: fixed
messages: + msg98876
2010-02-05 14:14:49floxsetnosy: + flox
messages: + msg98873

components: + Library (Lib)
keywords: + buildbot
2010-02-05 13:58:55pitroucreate