Opened 10 years ago

Last modified 10 years ago

#866 defect closed fixed (fixed)

Trial timeout handling is totally broken, won't accept even the default value

Reported by: Tv Owned by:
Priority: highest Milestone:
Component: trial Keywords:
Cc: radix, spiv, Tv, jknight, slyphon, hypatia Branch:
Author: Launchpad Bug:

Description


Change History (6)

comment:1 Changed 10 years ago by Tv

[0 tv@tao ~/src/twisted/trunk]$ python -c 'from twisted.internet import defer;
from twisted.trial import util; d=defer.Deferred(); util.wait(d)'
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/home/tv/src/twisted/trunk/twisted/trial/util.py", line 340, in wait
    r.raiseException()
  File "/home/tv/src/twisted/trunk/twisted/trial/util.py", line 332, in wait
    r = _Wait.wait(d, timeout)
  File "/home/tv/src/twisted/trunk/twisted/trial/util.py", line 269, in wait
    itimeout = itrial.ITimeout(timeout)
  File "/usr/lib/python2.3/site-packages/zope/interface/interface.py", line 682,
in __call__
    raise TypeError("Could not adapt", obj, self)
TypeError: ('Could not adapt', 4.0, <InterfaceClass twisted.trial.itrial.ITimeout>)
[1 tv@tao ~/src/twisted/trunk]$ svn info
Path: .
URL: svn+ssh://tv@cvs.twistedmatrix.com/svn/Twisted/trunk
Repository UUID: bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
Revision: 12881
Node Kind: directory
Schedule: normal
Last Changed Author: spiv
Last Changed Rev: 12881
Last Changed Date: 2005-01-17 10:44:30 +0200 (Mon, 17 Jan 2005)
Properties Last Updated: 2004-12-10 23:12:12 +0200 (Fri, 10 Dec 2004)

[0 tv@tao ~/src/twisted/trunk]$

comment:2 Changed 10 years ago by jknight

Works fine in trial. It's broken when using outside the context of trial. 
It seems like a bad thing to officially support anyways. If we want a 
general-purpose 'wait' API, it should really go somewhere else. Because of 
that, I don't think this bug is urgent, but I'll let release manager 
decide.

I think the brokenness is because of the craziness trial goes through in 
order that it can test itself in the same process as it's running, instead 
of a separate process as might be more sensible. (It uses a custom adapter 
registry to accomplish this.)

Perhaps it'd be okay for _setUpAdapters to be called from trial's __init__? 
I don't really know..

comment:3 Changed 10 years ago by spiv

If I recall correctly, this feature didn't exist in the previous release, so I
don't think this bug qualifies as urgent either.

It would be nice if it gave a more useful error message when used outside of the
normal trial context, and/or was documented to do so, but let's not make the
release depend on it!

comment:4 Changed 10 years ago by radix

what feature didn't exist in the previous release?

I just became more interested in this bug because it's causing me to not be 
able to use nevow-lore, which uses wait on nevow's renderString() deferred.

The existing twistedmatrix website, as well as hypatia's new 2.0 project 
website stuff, uses nevowlore, and I can't use it because of this. Making 
it not use wait() will be problematic, as lore doesn't support Deferreds on 
this level, afaik.  The only options I have are to write a lore-less nevow 
static file driver, or have trial's wait fixed.

comment:5 Changed 10 years ago by jknight

Fixed in r13015.

comment:6 Changed 4 years ago by <automation>

  • Owner slyphon deleted
Note: See TracTickets for help on using tickets.