[Zope3-dev] Win32 Tests - Zope 3 - Not OK :-(

Jeremy Hylton jeremy@zope.com
10 Mar 2003 10:50:57 -0500


On Sun, 2003-03-09 at 22:04, Tim Peters wrote:
> > Python Version:2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)]
> >
> > Modules included:
> > Zope3 (HEAD)
> >
> > Running tests from D:\ZopeTests\sandbox\Zope3
> > CRITICAL:txn:Transaction failed during second phase of two-phase commmit
> > Traceback (most recent call last):
> >   File "D:\ZopeTests\sandbox\Zope3\src\transaction\manager.py",
> > line 44, in _finishCommit
> >     r.commit(txn)
> >   File
> > "D:\ZopeTests\sandbox\Zope3\src\transaction\tests\test_txn.py",
> > line 41, in commit
> >     raise RuntimeError
> > RuntimeError
> > CRITICAL:txn:Transaction failed during second phase of two-phase commmit
> > Traceback (most recent call last):
> >   File "D:\ZopeTests\sandbox\Zope3\src\transaction\manager.py",
> > line 44, in _finishCommit
> >     r.commit(txn)
> >   File
> > "D:\ZopeTests\sandbox\Zope3\src\transaction\tests\test_txn.py",
> > line 41, in commit
> >     raise RuntimeError
> > RuntimeError
> > ----------------------------------------------------------------------
> > Ran 3530 tests in 276.016s
> >
> > OK
> 
> It really sucks that unittest doesn't consider thread deaths to be failures.

What makes you think threads are involved?

(We really ought to fix the unittest / thread problem, but I think
that's a thread for another time.  If we had a thread base class for use
with unittest that took the testcase as an argument, it could cause the
test to fail when it caught an unexpected exception.)

> Ignoring that <wink>, here are the tests that are failing on Windows:
> 
> testCommitFailure (transaction.tests.test_txn.SimpleTxnTests) ...
> CRITICAL:txn:Transaction failed during second phase of two-phase commmit
> Traceback (most recent call last):
>   File "C:\Code\Zope3\src\transaction\manager.py", line 44, in _finishCommit
>     r.commit(txn)
>   File "C:\Code\Zope3\src\transaction\tests\test_txn.py", line 41, in commit
>     raise RuntimeError
> RuntimeError
> ok

These tests aren't failing, but they are causing critical-level logging
messages to be generated.  I don't know how to disable the logging
during testing.  I think, ideally, we could add an assertion to the unit
test that a log message is generated.  The test in question provokes a
failure during the second phase of two-phase commit to test the error
handling in that case -- part of the error handling is to log a message.

Jeremy