1
0

Fix the tests after removing event_id column

This commit is contained in:
Olivier Wilkinson (reivilibre)
2020-08-27 09:00:47 +01:00
parent b1fd67bdf0
commit e6890c77df
2 changed files with 19 additions and 8 deletions

View File

@@ -409,6 +409,6 @@ class TransactionStore(SQLBaseStore):
"destination_rooms",
["destination", "room_id"],
rows,
["event_id", "stream_ordering"],
[(event_id, stream_ordering)] * len(rows),
["stream_ordering"],
[(stream_ordering,)] * len(rows),
)

View File

@@ -54,13 +54,24 @@ class FederationCatchUpTestCases(FederatingHomeserverTestCase):
Returns:
Dictionary of { event_id: str, stream_ordering: int }
"""
return self.get_success(
self.hs.get_datastore().db_pool.simple_select_one(
table="destination_rooms",
keyvalues={"destination": destination, "room_id": room},
retcols=["event_id", "stream_ordering"],
event_id, stream_ordering = self.get_success(
self.hs.get_datastore().db_pool.execute(
"test:get_destination_rooms",
None,
"""
SELECT event_id, stream_ordering
FROM destination_rooms dr
JOIN events USING (stream_ordering)
WHERE dr.destination = ? AND dr.room_id = ?
""",
destination,
room
)
)
)[0]
return {
"event_id": event_id,
"stream_ordering": stream_ordering
}
def make_fake_destination_queue(
self, destination: str = "host2"