-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
The matrix federation client uses an HTTP connection pool, which times out its idle HTTP connections, so there is no need for any of this business.
@@ -320,23 +320,23 @@ def _send_request( | |||
url_str, | |||
) | |||
|
|||
# we don't want all the fancy cookie and redirect handling that | |||
# treq.request gives: just use the raw Agent. | |||
request_deferred = self.agent.request( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason, the change makes this now throw some exceptions synchronously, hence moving it inside the try/catch. It should have been there anyway imho.
@@ -63,7 +66,7 @@ def test_client_never_connect(self): | |||
self.pump() | |||
|
|||
# Nothing happened yet | |||
self.assertFalse(d.called) | |||
self.assertNoResult(d) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this gives a slightly more helpful error when it fails.
Codecov Report
@@ Coverage Diff @@
## develop #4409 +/- ##
===========================================
- Coverage 73.65% 73.62% -0.04%
===========================================
Files 300 300
Lines 29815 29785 -30
Branches 4897 4896 -1
===========================================
- Hits 21961 21929 -32
- Misses 6412 6413 +1
- Partials 1442 1443 +1
Continue to review full report at Codecov.
|
tests/http/test_fedclient.py
Outdated
|
||
|
||
@implementer(ITransport) | ||
class MockTransport(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe https://twistedmatrix.com/documents/current/api/twisted.test.proto_helpers.StringTransport.html would reduce some duplication here? (twisted.test.proto_helpers
is public API)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes :)
rather than rolling our own test transport
@hawkowl: I was wondering about adding TLS into the tests, so that we could test the behaviour including the TLS layer. I started looking at Factories and Transports and Protocols, but soon found myself in a maze of twisty little passages, all alike. Have you any insights as to how one might do that? |
The matrix federation client uses an HTTP connection pool, which times out its idle HTTP connections, so there is no need for any of this business.