-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RequestTraversalAgent not practically usable with IBodyProducers #161
Comments
Put another way, this test fails:
because the |
Part of the problem here (by no means unfixable, but I think why it wasn't originally fixed) is the use of "adapt to |
Darn. I used RequestTraversalAgent in yet another test suite and once again the test can't work because of this behavior. |
Darn. I used RequestTraversalAgent in yet another test suite and once again the test can't work because of this behavior. |
It looks like there is a partial work-around for this. Instead of using |
There is another workaround: use |
Uh, I guess. Writing unit tests that do real I/O with the global reactor has a very 2009 feel to it, though, and one might question whether the solution is worse than the problem. |
FWIW, I usually work around this in test suites by either:
Of course neither of these strategies work for files, since you don't control the |
Data produced by an
IBodyProducer
will mostly just sit in aFakeTransport
buffer (after https://twistedmatrix.com/trac/ticket/9003 is fixed, anyway). It might get delivered somewhere by a manualpump
call but sincepump
is outside of theIAgent
interface it's very difficult to convince anything to actually call it.The consequence is a request made with RequestTraversalAgent and an IBodyProducer will probably hang indefinitely.
The text was updated successfully, but these errors were encountered: