-
Notifications
You must be signed in to change notification settings - Fork 411
Work around twisted.protocols.amp.TooLong error by reducing logging in some tests.
#18736
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
Changes from 3 commits
0685482
5987c9d
f0e934e
7ae8819
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Work around `twisted.protocols.amp.TooLong` error by reducing logging in some tests. |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |||||||||||||
| # [This file includes modifications made by New Vector Limited] | ||||||||||||||
| # | ||||||||||||||
| # | ||||||||||||||
| import logging | ||||||||||||||
| from unittest.mock import Mock | ||||||||||||||
|
|
||||||||||||||
| from synapse.handlers.typing import RoomMember, TypingWriterHandler | ||||||||||||||
|
|
@@ -99,75 +100,83 @@ def test_reset(self) -> None: | |||||||||||||
| This is emulated by jumping the stream ahead, then reconnecting (which | ||||||||||||||
| sends the proper position and RDATA). | ||||||||||||||
| """ | ||||||||||||||
| typing = self.hs.get_typing_handler() | ||||||||||||||
| assert isinstance(typing, TypingWriterHandler) | ||||||||||||||
|
|
||||||||||||||
| # Create a typing update before we reconnect so that there is a missing | ||||||||||||||
| # update to fetch. | ||||||||||||||
| typing._push_update(member=RoomMember(ROOM_ID, USER_ID), typing=True) | ||||||||||||||
|
|
||||||||||||||
| self.reconnect() | ||||||||||||||
|
|
||||||||||||||
| typing._push_update(member=RoomMember(ROOM_ID, USER_ID), typing=True) | ||||||||||||||
|
|
||||||||||||||
| self.reactor.advance(0) | ||||||||||||||
|
|
||||||||||||||
| # We should now see an attempt to connect to the master | ||||||||||||||
| request = self.handle_http_replication_attempt() | ||||||||||||||
| self.assert_request_is_get_repl_stream_updates(request, "typing") | ||||||||||||||
|
|
||||||||||||||
| self.mock_handler.on_rdata.assert_called_once() | ||||||||||||||
| stream_name, _, token, rdata_rows = self.mock_handler.on_rdata.call_args[0] | ||||||||||||||
| self.assertEqual(stream_name, "typing") | ||||||||||||||
| self.assertEqual(1, len(rdata_rows)) | ||||||||||||||
| row: TypingStream.TypingStreamRow = rdata_rows[0] | ||||||||||||||
| self.assertEqual(ROOM_ID, row.room_id) | ||||||||||||||
| self.assertEqual([USER_ID], row.user_ids) | ||||||||||||||
|
|
||||||||||||||
| # Push the stream forward a bunch so it can be reset. | ||||||||||||||
| for i in range(100): | ||||||||||||||
| typing._push_update( | ||||||||||||||
| member=RoomMember(ROOM_ID, "@test%s:blue" % i), typing=True | ||||||||||||||
| # A huge RDATA log line is triggered in this test, which breaks trial | ||||||||||||||
| # ref: https://github.com/twisted/twisted/issues/12482 | ||||||||||||||
|
||||||||||||||
| # A huge RDATA log line is triggered in this test, which breaks trial | |
| # ref: https://github.com/twisted/twisted/issues/12482 | |
| # FIXME: Because we emit a huge RDATA log line and trial sometimes crashes on | |
| # these, disable that logger for this test. This can be removed once | |
| # https://github.com/twisted/twisted/issues/12482 is solved and we update | |
| # Twisted to version that includes the fix. |
(applies to other spot as well)
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.
annoyingly, given the olddeps trial run, we actually can't remove this for several years even if we fix Trial :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.
(guess I should add that caveat to the comment though)
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.