summary refs log tree commit diff
path: root/tests/replication/slave/storage/_base.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-04-02 13:47:08 +0100
committerRichard van der Hoff <richard@matrix.org>2019-04-02 13:47:08 +0100
commitf41c9d37d6acce042d86d2e6b146a881cfffd8a9 (patch)
tree4b12f0213c9e44865336071edafe95195506a85a /tests/replication/slave/storage/_base.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff)
parentFix sync bug when accepting invites (#4956) (diff)
downloadsynapse-f41c9d37d6acce042d86d2e6b146a881cfffd8a9.tar.xz
Merge branch 'develop' into matrix-org-hotfixes
Diffstat (limited to 'tests/replication/slave/storage/_base.py')
-rw-r--r--tests/replication/slave/storage/_base.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/tests/replication/slave/storage/_base.py b/tests/replication/slave/storage/_base.py

index 524af4f8d1..1f72a2a04f 100644 --- a/tests/replication/slave/storage/_base.py +++ b/tests/replication/slave/storage/_base.py
@@ -56,7 +56,9 @@ class BaseSlavedStoreTestCase(unittest.HomeserverTestCase): client = client_factory.buildProtocol(None) client.makeConnection(FakeTransport(server, reactor)) - server.makeConnection(FakeTransport(client, reactor)) + + self.server_to_client_transport = FakeTransport(client, reactor) + server.makeConnection(self.server_to_client_transport) def replicate(self): """Tell the master side of replication that something has happened, and then @@ -69,6 +71,24 @@ class BaseSlavedStoreTestCase(unittest.HomeserverTestCase): master_result = self.get_success(getattr(self.master_store, method)(*args)) slaved_result = self.get_success(getattr(self.slaved_store, method)(*args)) if expected_result is not None: - self.assertEqual(master_result, expected_result) - self.assertEqual(slaved_result, expected_result) - self.assertEqual(master_result, slaved_result) + self.assertEqual( + master_result, + expected_result, + "Expected master result to be %r but was %r" % ( + expected_result, master_result + ), + ) + self.assertEqual( + slaved_result, + expected_result, + "Expected slave result to be %r but was %r" % ( + expected_result, slaved_result + ), + ) + self.assertEqual( + master_result, + slaved_result, + "Slave result %r does not match master result %r" % ( + slaved_result, master_result + ), + )