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

Commit

Permalink
Fix postgres test
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Apr 30, 2020
1 parent e9b5c64 commit da1f596
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions tests/replication/tcp/streams/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ def test_update_function_event_row_limit(self):
self.reconnect()
self.replicate()

# we should have received all the expected rows in the right order
received_rows = self.test_handler.received_rdata_rows
# we should have received all the expected rows in the right order (as
# well as various cache invalidation updates which we ignore)
received_rows = [
row for row in self.test_handler.received_rdata_rows if row[0] == "events"
]

for event in events:
stream_name, token, row = received_rows.pop(0)
self.assertEqual("events", stream_name)
Expand Down Expand Up @@ -183,7 +187,8 @@ def test_update_function_huge_state_change(self):
self.reconnect()
self.replicate()

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

received_rows = self.test_handler.received_rdata_rows
received_rows = [
row for row in self.test_handler.received_rdata_rows if row[0] == "events"
]

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

Expand Down Expand Up @@ -333,9 +340,11 @@ def test_update_function_state_row_limit(self):
self.reconnect()
self.replicate()

# we should have received all the expected rows in the right order

received_rows = self.test_handler.received_rdata_rows
# we should have received all the expected rows in the right order (as
# well as various cache invalidation updates which we ignore)
received_rows = [
row for row in self.test_handler.received_rdata_rows if row[0] == "events"
]
self.assertGreaterEqual(len(received_rows), len(events))
for i in range(NUM_USERS):
# for each user, we expect the PL event row, followed by state rows for
Expand Down

0 comments on commit da1f596

Please sign in to comment.