Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions test/integration/interrupt_resume_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ def test_interrupt_resume_without_writes_to_source_to_check_target_state_when_in

result = target_db.query("SELECT COUNT(*) AS cnt FROM #{DEFAULT_FULL_TABLE_NAME}")
count = result.first["cnt"]
assert_equal 200, count
# TERM is delivered asynchronously so the signal may arrive after the
# second batch has already been written. At least one batch (200 rows)
# must have been copied; more is also acceptable as we are verifying
# the last_successful_id later on against the dumped state.
assert_operator count, :>=, 200

result = target_db.query("SELECT MAX(id) AS max_id FROM #{DEFAULT_FULL_TABLE_NAME}")
last_successful_id = result.first["max_id"]
Expand Down Expand Up @@ -701,7 +705,10 @@ def test_interrupt_resume_without_writes_to_source_with_uuid_table

result = target_db.query("SELECT COUNT(*) AS cnt FROM #{UUID_FULL_TABLE_NAME}")
count = result.first["cnt"]
assert_equal 200, count
# Same as the integer-keyed variant: TERM is async so at least one batch
# (200 rows) must be copied; a second batch landing first is also valid.
# We are verifying the last_successful_id_bytes later on against the dumped state.
assert_operator count, :>=, 200

result = target_db.query("SELECT MAX(uuid) AS max_id FROM #{UUID_FULL_TABLE_NAME}")
last_successful_id_bytes = result.first["max_id"]
Expand Down
Loading