From e9ee32d4af8e172f3e94e75175b827c309ca40a1 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Wed, 29 Nov 2023 10:25:20 +0300 Subject: [PATCH] Added/Updated tests\functional\replication\test_oltp_emul_ddl.py: problems that can occus during initial DDL must be reflected in the variable with distinct name: 'out_init'. --- tests/functional/replication/test_oltp_emul_ddl.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/functional/replication/test_oltp_emul_ddl.py b/tests/functional/replication/test_oltp_emul_ddl.py index a52545ea..75e918cb 100644 --- a/tests/functional/replication/test_oltp_emul_ddl.py +++ b/tests/functional/replication/test_oltp_emul_ddl.py @@ -412,7 +412,8 @@ def get_replication_log(a: Action): def test_1(act_db_main: Action, act_db_repl: Action, tmp_oltp_build_sql: Path, tmp_oltp_build_log: Path, capsys): tmp_oltp_sql_files = [] - out_prep, out_main, out_drop = '', '', '' + + out_prep, out_init, out_main, out_drop = '', '', '', '' # Obtain full path + filename for DB_MAIN and DB_REPL aliases. # NOTE: we must NOT use 'a.db.db_path' for ALIASED databases! # It will return '.' rather than full path+filename. @@ -507,7 +508,7 @@ def test_1(act_db_main: Action, act_db_repl: Action, tmp_oltp_build_sql: Path, act_db_main.isql(switches=['-q', '-nod'], input_file = str(tmp_oltp_build_sql), io_enc = locale.getpreferredencoding(), combine_output = True) if act_db_main.return_code: - out_prep = act_db_main.clean_stdout + out_init= '\n'.join( ('act_db_main.return_code = %d' % act_db_main.return_code, act_db_main.clean_stdout ) ) act_db_main.reset() @@ -519,7 +520,7 @@ def test_1(act_db_main: Action, act_db_repl: Action, tmp_oltp_build_sql: Path, repl_log_new = get_replication_log(act_db_main) - if out_prep: + if out_init: # Some problem raised during execution of initial SQL pass else: @@ -561,7 +562,7 @@ def test_1(act_db_main: Action, act_db_repl: Action, tmp_oltp_build_sql: Path, # Must be EMPTY: out_drop = capsys.readouterr().out - if [ x for x in (out_prep, out_main, out_drop) if x.strip() ]: + if [ x for x in (out_prep, out_init, out_main, out_drop) if x.strip() ]: # We have a problem either with DDL/DML or with dropping DB objects. # First, we have to RECREATE both master and slave databases # (otherwise further execution of this test or other replication-related tests most likely will fail): @@ -572,6 +573,8 @@ def test_1(act_db_main: Action, act_db_repl: Action, tmp_oltp_build_sql: Path, print('Problem(s) detected:') if out_prep.strip(): print('out_prep:\n', out_prep) + if out_init.strip(): + print('out_init:\n', out_init) if out_main.strip(): print('out_main:\n', out_main) if out_drop.strip():