Ticket #3796 defect closed fixed

Opened 4 years ago

Last modified 23 months ago

Intermittent failure of twisted.web.test.test_webclient.WebClientSSLTestCase.test_timeoutTriggering

Reported by: exarkun Owned by: exarkun
Priority: normal Milestone:
Component: core Keywords: tests
Cc: Branch: branches/oldwebclient-cleanup-3796
Author: exarkun Launchpad Bug:

Description

On OS X, I saw this fail (while working on #3782):

[ERROR]: twisted.web.test.test_webclient.WebClientSSLTestCase.test_timeoutTriggering
Traceback (most recent call last):
Failure: twisted.trial.util.DirtyReactorAggregateError: Reactor was unclean.
Selectables:
<<class 'twisted.internet.tcp.TLSConnection'> to ('127.0.0.1', 59660) at 1345af0>

Change History

1

Changed 2 years ago by <automation>

  • owner exarkun deleted

2

Changed 23 months ago by exarkun

  • branch set to branches/oldwebclient-cleanup-3796
  • branch_author set to exarkun

(In [32326]) Branching to 'oldwebclient-cleanup-3796'

3

Changed 23 months ago by exarkun

  • keywords review added

I changed getPage and downloadPage to only fire their result Deferred after the underlying connection gives the HTTPClient its connectionLost notification.

I tested this change in the #5118 branch (with the icky tearDown added in that branch deleted) on my Ubuntu Karmic box to verify it actually solves the problems encountered there, and it does. As is the branch fails 5 webclient ssl tests there, with this patch it passes them all reliably.

 Build results

4

Changed 23 months ago by glyph

  • keywords review removed
  • owner set to exarkun

Aah, what a nice, self-contained change. Looks great. Should make naive third-party tests using getPage a bit more reliable, too. (And thanks for the pyflakes fixes.)

No further comments; please land.

5

Changed 23 months ago by exarkun

  • status changed from new to closed
  • resolution set to fixed

(In [32329]) Merge oldwebclient-cleanup-3796

Author: exarkun Reviewer: glyph Fixes: #3796

Change twisted.web.client.getPage and twisted.web.client.downloadPage to not fire their returned Deferred until the connection used for the request each issues is closed. This avoids problems in unit tests using these APIs where trial reports an unclean reactor due to these connections still being up when the test thinks it is finished.

Note: See TracTickets for help on using tickets.