[Python-Dev] test_logging failing on Windows 2000 (original) (raw)
Guido van Rossum guido@python.org
Wed, 15 Jan 2003 22:02:23 -0500
- Previous message: [Python-Dev] test_logging failing on Windows 2000
- Next message: [Python-Dev] test_logging failing on Windows 2000
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Mark Hammond] > For some reason, testlogging.py is failing on my machine - but only when > run via "regrtest.py" - running stand-alone works fine. > > The output I see is: > > testlogging > Traceback (most recent call last): > File "E:\src\python-cvs\lib\logging_init.py", line 645, in emit_ > self.stream.write("%s\n" % msg) > ValueError: I/O operation on closed file > Traceback (most recent call last): > File "E:\src\python-cvs\lib\logging_init.py", line 645, in emit_ > self.stream.write("%s\n" % msg) > Vtest testlogging produced unexpected output: > > [Sometimes the "ValueError" will be repeated quite a few times. > Often these exceptions are intermingled with the next test output - ie, > the logging test continues to run even once the following test has > started.
[Tim]
I haven't seen this (yet), on Win2K or Win98.
> I am guessing that some threads are spawned, but for some reason we > aren't waiting for them to complete before closing the output file. > > I will have a look at this once I actually finish what I was trying to > start - but if someone has a clue, let me know! I didn't see anything obvious. The logging module itself doesn't spawn any threads, but the test driver does. You'd think that would narrow it down .
Here's what the test driver does:
It creates one thread which runs a subclass of SocketServer.ThreadingTCPServer, and starts the thread.
It runs a bunch of tests that all log to that server.
ThreadingTCPServer creates a new thread for each incoming connection, and makes this a daemon thread (meaning it won't be waited for at the end of the process).
Two lines above "finally:", sockOut is closed. I believe this is crucial:
The threads handling the requests are still running, and there's nothing to guarantee that they have processed all requests.
The test driver needs to somehow wait until all the threads handling connections (how many? maybe there's only one?) are finished before it closes sockOut.
Vinay, can you suggest a patch?
--Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] test_logging failing on Windows 2000
- Next message: [Python-Dev] test_logging failing on Windows 2000
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]