Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit da1f596

Browse files
committed
Fix postgres test
1 parent e9b5c64 commit da1f596

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

tests/replication/tcp/streams/test_events.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ def test_update_function_event_row_limit(self):
7979
self.reconnect()
8080
self.replicate()
8181

82-
# we should have received all the expected rows in the right order
83-
received_rows = self.test_handler.received_rdata_rows
82+
# we should have received all the expected rows in the right order (as
83+
# well as various cache invalidation updates which we ignore)
84+
received_rows = [
85+
row for row in self.test_handler.received_rdata_rows if row[0] == "events"
86+
]
87+
8488
for event in events:
8589
stream_name, token, row = received_rows.pop(0)
8690
self.assertEqual("events", stream_name)
@@ -183,7 +187,8 @@ def test_update_function_huge_state_change(self):
183187
self.reconnect()
184188
self.replicate()
185189

186-
# now we should have received all the expected rows in the right order.
190+
# we should have received all the expected rows in the right order (as
191+
# well as various cache invalidation updates which we ignore)
187192
#
188193
# we expect:
189194
#
@@ -192,7 +197,9 @@ def test_update_function_huge_state_change(self):
192197
# of the states that got reverted.
193198
# - two rows for state2
194199

195-
received_rows = self.test_handler.received_rdata_rows
200+
received_rows = [
201+
row for row in self.test_handler.received_rdata_rows if row[0] == "events"
202+
]
196203

197204
# first check the first two rows, which should be state1
198205

@@ -333,9 +340,11 @@ def test_update_function_state_row_limit(self):
333340
self.reconnect()
334341
self.replicate()
335342

336-
# we should have received all the expected rows in the right order
337-
338-
received_rows = self.test_handler.received_rdata_rows
343+
# we should have received all the expected rows in the right order (as
344+
# well as various cache invalidation updates which we ignore)
345+
received_rows = [
346+
row for row in self.test_handler.received_rdata_rows if row[0] == "events"
347+
]
339348
self.assertGreaterEqual(len(received_rows), len(events))
340349
for i in range(NUM_USERS):
341350
# for each user, we expect the PL event row, followed by state rows for

0 commit comments

Comments
 (0)