From 52a42f95416f809552863a7e8e3d77f6813dbb3d Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Sat, 23 Dec 2023 15:28:51 +0300 Subject: [PATCH] Added/Updated tests\functional\replication\test_shutdown_during_applying_segments_leads_to_crash.py: Make final SWEEP optional, depending on setting RUN_SWEEP_AT_END - see $QA_ROOT/files/test_config.ini. --- ...during_applying_segments_leads_to_crash.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/functional/replication/test_shutdown_during_applying_segments_leads_to_crash.py b/tests/functional/replication/test_shutdown_during_applying_segments_leads_to_crash.py index 1468a297..74f84428 100644 --- a/tests/functional/replication/test_shutdown_during_applying_segments_leads_to_crash.py +++ b/tests/functional/replication/test_shutdown_during_applying_segments_leads_to_crash.py @@ -34,14 +34,14 @@ DESCRIPTION: The only difference in metadata must be 'CREATE DATABASE' statement with different DB names - we suppress it, thus metadata difference must not be issued. +FBTEST: tests.functional.replication.shutdown_during_applying_segments_leads_to_crash +NOTES: Confirmed bug on 5.0.0.215: server crashed, firebird.log contains message: "Fatal lock manager error: invalid lock id (0), errno: 0". Validation of replica DB shows lot of orphan pages (but no errors). This is the same bug as described in the ticked (discussed with dimitr, letters 22.09.2021). -FBTEST: tests.functional.replication.shutdown_during_applying_segments_leads_to_crash -NOTES: [27.08.2022] pzotov Warning raises on Windows and Linux: ../../../usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1126 @@ -78,6 +78,9 @@ NOTES: Because of this, attempt to drop this file exactly at that moment causes on Windows "PermissionError: [WinError 32]". This error must NOT propagate and interrupt entire test. Rather, we must only to log name of file that can not be dropped. + [23.11.2023] pzotov + Make final SWEEP optional, depending on setting RUN_SWEEP_AT_END - see $QA_ROOT/files/test_config.ini. + Checked on Windows, 6.0.0.193, 5.0.0.1304, 4.0.5.3042 (SS/CS for all). """ import os @@ -105,6 +108,7 @@ REPLICA_TIMEOUT_FOR_ERROR = int(repl_settings['replica_timeout_for_error']) MAIN_DB_ALIAS = repl_settings['main_db_alias'] REPL_DB_ALIAS = repl_settings['repl_db_alias'] +RUN_SWEEP_AT_END = int(repl_settings['run_sweep_at_end']) db_main = db_factory( filename = '#' + MAIN_DB_ALIAS, do_not_create = True, do_not_drop = True) db_repl = db_factory( filename = '#' + REPL_DB_ALIAS, do_not_create = True, do_not_drop = True) @@ -356,13 +360,15 @@ def drop_db_objects(act_db_main: Action, act_db_repl: Action, capsys): else: db_repl_meta = a.extract_meta(charset = 'utf8', io_enc = 'utf8') - ###################### - ### A C H T U N G ### - ###################### - # MANDATORY, OTHERWISE REPLICATION GETS STUCK ON SECOND RUN OF THIS TEST - # WITH 'ERROR: Record format with length NN is not found for table TEST': - a.gfix(switches=['-sweep', a.db.dsn]) - + if RUN_SWEEP_AT_END: + # Following sweep was mandatory during 2021...2022. Problem was fixed: + # * for FB 4.x: 26-jan-2023, commit 2ed48a62c60c029cd8cb2b0c914f23e1cb56580a + # * for FB 5.x: 20-apr-2023, commit 5af209a952bd2ec3723d2c788f2defa6b740ff69 + # (log message: 'Avoid random generation of field IDs, respect the user-specified order instead'). + # Until this problem was solved, subsequent runs of this test caused to fail with: + # 'ERROR: Record format with length NN is not found for table TEST' + # + a.gfix(switches=['-sweep', a.db.dsn]) # Final point: metadata must become equal: #