diff --git a/test/integration/inline_verifier_test.rb b/test/integration/inline_verifier_test.rb index b85aeab1..97c209f8 100644 --- a/test/integration/inline_verifier_test.rb +++ b/test/integration/inline_verifier_test.rb @@ -536,28 +536,6 @@ def test_null_in_different_order assert_equal "cutover verification failed for: gftest.test_table_1 [paginationKeys: 1 ] ", ghostferry.error_lines.last["msg"] end - def test_inline_verifier_fails_if_database_schema_is_changed_during_data_copy - seed_simple_database_with_single_table - - ghostferry = new_ghostferry(MINIMAL_GHOSTFERRY, config: { verifier_type: "Inline" }) - - verification_ran = false - batches_written = 0 - ghostferry.on_status(Ghostferry::Status::AFTER_ROW_COPY) do - batches_written += 1 - if batches_written == 1 - source_db.query("ALTER TABLE #{DEFAULT_FULL_TABLE_NAME} ADD COLUMN extracolumn VARCHAR(15);") - end - end - - error_occured = false - ghostferry.on_callback("error") do |err| - raise "ghostferry error ocurred - #{err}" - end - - ghostferry.run - end - ################### # Collation Tests # ################### diff --git a/test/integration/interrupt_resume_test.rb b/test/integration/interrupt_resume_test.rb index 08cf3eeb..5cf894b1 100644 --- a/test/integration/interrupt_resume_test.rb +++ b/test/integration/interrupt_resume_test.rb @@ -518,6 +518,19 @@ def test_interrupt_resume_idempotence_with_failure_and_writes_to_source assert_ghostferry_completed(ghostferry, times: 1) end + def test_interrupt_resume_failure_with_database_schema_changed_during_interrupt + ghostferry = new_ghostferry(MINIMAL_GHOSTFERRY) + + ghostferry.on_status(Ghostferry::Status::AFTER_ROW_COPY) do + ghostferry.term_and_wait_for_exit + end + + dumped_state = ghostferry.run_expecting_interrupt + source_db.query("ALTER TABLE #{DEFAULT_FULL_TABLE_NAME} ADD COLUMN extracolumn VARCHAR(15);") + + ghostferry.run_expecting_failure(dumped_state) + end + def test_resume_from_failure_with_state_callback ghostferry = new_ghostferry(MINIMAL_GHOSTFERRY) diff --git a/test/integration/trivial_test.rb b/test/integration/trivial_test.rb index 246d31ba..0a47a8ff 100644 --- a/test/integration/trivial_test.rb +++ b/test/integration/trivial_test.rb @@ -39,4 +39,19 @@ def test_logged_query_omits_columns end end end + + def test_fails_if_database_schema_is_changed_during_data_copy + seed_simple_database_with_single_table + ghostferry = new_ghostferry(MINIMAL_GHOSTFERRY) + + batches_written = 0 + ghostferry.on_status(Ghostferry::Status::AFTER_ROW_COPY) do + batches_written += 1 + if batches_written == 1 + source_db.query("ALTER TABLE #{DEFAULT_FULL_TABLE_NAME} ADD COLUMN extracolumn VARCHAR(15);") + end + end + + ghostferry.run_expecting_failure + end end