diff options
author | Yuchen Pei <yuchen.pei@mariadb.com> | 2023-01-18 11:51:28 +1100 |
---|---|---|
committer | Yuchen Pei <yuchen.pei@mariadb.com> | 2023-03-22 11:48:06 +1100 |
commit | 88a589d4efa9c419a6bf3390740d4f92cc8c1de4 (patch) | |
tree | 52a1c37b4b9c63835fc848b790c7488e52743013 | |
parent | 4c4939bbf619d7e516131c0b3e5691b1c2d2ff8f (diff) | |
download | mariadb-git-bb-10.3-mdev-27912.tar.gz |
MDEV-27912 Fixing inconsistency w.r.t. expect files in tests.bb-10.3-mdev-27912
mtr uses group suffix, but some existing inc and test files use
server_id for expect files. This patch aims to fix that.
For spider:
With this change we will not have to maintain a separate version of
restart_mysqld.inc for spider, that duplicates code, just because
spider tests use different names for expect files, and shutdown_mysqld
requires magical names for them.
With this change spider tests will also be able to use other features
provided by restart_mysqld.inc without code duplication, like the
parameter $restart_parameters (see e.g. the testcase mdev_29904.test
in commit ef1161e5d4f).
Tests run after this change: default, spider, rocksdb, galera, using
the following command
mtr --parallel=auto --force --max-test-fail=0 --skip-core-file
mtr --suite spider,spider/*,spider/*/* \
--skip-test="spider/oracle.*|.*/t\..*" --parallel=auto --big-test \
--force --max-test-fail=0 --skip-core-file
mtr --suite galera --parallel=auto
mtr --suite rocksdb --parallel=auto
23 files changed, 40 insertions, 48 deletions
diff --git a/mysql-test/include/expect_crash.inc b/mysql-test/include/expect_crash.inc index af8b0908104..b4bd9828a08 100644 --- a/mysql-test/include/expect_crash.inc +++ b/mysql-test/include/expect_crash.inc @@ -1,5 +1,5 @@ ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect # There should be a debug crash after using this .inc file --exec echo "wait" > $_expect_file_name diff --git a/mysql-test/include/kill_mysqld.inc b/mysql-test/include/kill_mysqld.inc index 86ee048a0f1..01ee7f82bdc 100644 --- a/mysql-test/include/kill_mysqld.inc +++ b/mysql-test/include/kill_mysqld.inc @@ -1,5 +1,5 @@ ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --echo # Kill the server --exec echo "wait" > $_expect_file_name diff --git a/mysql-test/include/shutdown_mysqld.inc b/mysql-test/include/shutdown_mysqld.inc index 74a3028946d..9518b880e89 100644 --- a/mysql-test/include/shutdown_mysqld.inc +++ b/mysql-test/include/shutdown_mysqld.inc @@ -22,8 +22,8 @@ if ($rpl_inited) } # Write file to make mysql-test-run.pl expect the "crash", but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name --let $server_shutdown_timeout= 60 diff --git a/mysql-test/main/shutdown.test b/mysql-test/main/shutdown.test index b670cfc2699..1e9d8e9ba92 100644 --- a/mysql-test/main/shutdown.test +++ b/mysql-test/main/shutdown.test @@ -18,8 +18,8 @@ disconnect c1; create procedure try_shutdown() shutdown; drop procedure try_shutdown; ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name --send shutdown diff --git a/mysql-test/suite/galera/include/kill_galera.inc b/mysql-test/suite/galera/include/kill_galera.inc index 56118df84f9..28a1b0f368c 100644 --- a/mysql-test/suite/galera/include/kill_galera.inc +++ b/mysql-test/suite/galera/include/kill_galera.inc @@ -6,8 +6,8 @@ if (!$kill_signal) } # Write file to make mysql-test-run.pl expect the crash, but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name # Kill the connected server diff --git a/mysql-test/suite/galera/include/shutdown_mysqld.inc b/mysql-test/suite/galera/include/shutdown_mysqld.inc index 54bba1318e7..793be8d76ac 100644 --- a/mysql-test/suite/galera/include/shutdown_mysqld.inc +++ b/mysql-test/suite/galera/include/shutdown_mysqld.inc @@ -8,8 +8,8 @@ if ($rpl_inited) } # Write file to make mysql-test-run.pl expect the "crash", but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name # Send shutdown to the connected server diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test index 686fb0b3f76..51c4764d645 100644 --- a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test +++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test @@ -35,8 +35,8 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2; --connection node_2 # Write file to make mysql-test-run.pl expect the crash, but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name --let KILL_NODE_PIDFILE = `SELECT @@pid_file` diff --git a/mysql-test/suite/innodb/t/alter_crash.test b/mysql-test/suite/innodb/t/alter_crash.test index 72116b0ca9d..70ec4e22948 100644 --- a/mysql-test/suite/innodb/t/alter_crash.test +++ b/mysql-test/suite/innodb/t/alter_crash.test @@ -50,8 +50,8 @@ let $MYSQLD_DATADIR= `select @@datadir`; let datadir= `select @@datadir`; # These are from include/shutdown_mysqld.inc and allow to call start_mysqld.inc ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --echo # --echo # Bug #14669848 CRASH DURING ALTER MAKES ORIGINAL TABLE INACCESSIBLE diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test index cbf8ff9e87f..d5295fc678b 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test +++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test @@ -29,8 +29,8 @@ call mtr.add_suppression("InnoDB could not find key no 1 with name f2 from dict let datadir= `select @@datadir`; ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; SET debug_dbug='+d,innodb_alter_commit_crash_before_commit'; diff --git a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test index 79d9cc814a0..2f0377ff80e 100644 --- a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test +++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test @@ -25,8 +25,8 @@ CREATE TABLE t1( INDEX(b)) ENGINE=InnoDB STATS_PERSISTENT=0; ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect # The flag innodb_change_buffering_debug is only available in debug builds. # It instructs InnoDB to try to evict pages from the buffer pool when diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test index b2809aa0669..d8650aeff6f 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test @@ -36,8 +36,8 @@ SET GLOBAL innodb_file_per_table = 1; CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; INSERT INTO t1 VALUES(1),(2),(3); ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_discard_before_commit_crash"; diff --git a/mysql-test/suite/innodb/t/purge_thread_shutdown.test b/mysql-test/suite/innodb/t/purge_thread_shutdown.test index 8a9a834454c..7ad93aaf151 100644 --- a/mysql-test/suite/innodb/t/purge_thread_shutdown.test +++ b/mysql-test/suite/innodb/t/purge_thread_shutdown.test @@ -12,8 +12,8 @@ select user,state from information_schema.processlist order by 2; set global debug_dbug='+d,only_kill_system_threads'; set global innodb_fast_shutdown=0; -let $_server_id= `SELECT @@server_id`; -let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect; +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect exec echo "wait" > $_expect_file_name; send shutdown; diff --git a/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test b/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test index f1d1537237e..b82eb1eac3a 100644 --- a/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test +++ b/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test @@ -29,8 +29,8 @@ while ($i) } --enable_query_log ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name SET debug_dbug = '+d,increase_mtr_checkpoint_size'; diff --git a/mysql-test/suite/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test index eecb62ad464..ddd637c81a6 100644 --- a/mysql-test/suite/innodb/t/restart.test +++ b/mysql-test/suite/innodb/t/restart.test @@ -109,8 +109,6 @@ SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; --echo # --let MYSQLD_DATADIR= `SELECT @@datadir` ---let SERVER_ID= `SELECT @@server_id` ---let EXPECT_FILE_NAME= $MYSQLTEST_VARDIR/tmp/mysqld.$SERVER_ID.expect --source include/shutdown_mysqld.inc diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test index cc290b03c34..0549bab2779 100644 --- a/mysql-test/suite/innodb/t/temporary_table.test +++ b/mysql-test/suite/innodb/t/temporary_table.test @@ -11,7 +11,7 @@ --source include/no_valgrind_without_big.inc --disable_query_log -call mtr.add_suppression("Can't create/write to file '/dev/null/nonexistent/ib"); +call mtr.add_suppression("Can't create/write to file '/dev/null/.*/ib"); call mtr.add_suppression("InnoDB: Unable to create temporary file"); call mtr.add_suppression("last file in setting innodb_temp_data_file_path"); call mtr.add_suppression("The table 't1' is full"); @@ -134,7 +134,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); # We cannot use include/restart_mysqld.inc in this particular test, # because SHOW STATUS would fail due to unwritable (nonexistent) tmpdir. --source include/shutdown_mysqld.inc ---exec echo "restart: --tmpdir=/dev/null/nonexistent" > $_expect_file_name +--exec echo "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR" > $_expect_file_name --enable_reconnect --disable_result_log --disable_query_log diff --git a/mysql-test/suite/innodb_fts/t/sync.test b/mysql-test/suite/innodb_fts/t/sync.test index 3bd5b56a21b..e4f04ef4269 100644 --- a/mysql-test/suite/innodb_fts/t/sync.test +++ b/mysql-test/suite/innodb_fts/t/sync.test @@ -104,7 +104,8 @@ disconnect con1; DROP TABLE t1; --echo # Case 3: Test insert crash recovery ---let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect CREATE TABLE t1 ( FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, diff --git a/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc b/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc index 81cd2200ae0..a87fe01b3a1 100644 --- a/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc +++ b/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc @@ -9,8 +9,8 @@ if ($rpl_inited) # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name # Send shutdown to the connected server and give diff --git a/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test b/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test index 67b2d5f96d7..5f542915642 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test @@ -14,6 +14,7 @@ # restart server to change error log and ignore corruptopn on startup --let $_mysqld_option=--log-error=$LOG --rocksdb_allow_to_start_after_corruption=1 --source include/restart_mysqld_with_option.inc +--let $_server_id= `SELECT @@server_id` --echo # --echo # Test server crashes on corrupted data and restarts diff --git a/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test b/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test index 49e5e5c1172..da9d8602c01 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test @@ -4,8 +4,8 @@ DROP TABLE IF EXISTS t1; --enable_warnings ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_cache_file_name= $MYSQLTEST_VARDIR/tmp/persistent_cache --exec echo "wait" >$_expect_file_name diff --git a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test index e7ab37d2658..b2647b38e08 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test @@ -17,8 +17,8 @@ CREATE TABLE t2 (pk int primary key) ENGINE=ROCKSDB PARTITION BY KEY(pk) PARTITI # Write file to make mysql-test-run.pl expect the "crash", but don't restart the # server until it is told to ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let LOG=$MYSQLTEST_VARDIR/tmp/validate_datadic.err --exec echo "wait" >$_expect_file_name diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test index 743f942af9c..1daa9898c1a 100644 --- a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test +++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test @@ -7,8 +7,8 @@ SET @@global.rocksdb_rate_limiter_bytes_per_sec = 10000; # Write file to make mysql-test-run.pl expect the "crash", but don't restart the # server until it is told to ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" >$_expect_file_name # Send shutdown to the connected server and give it 10 seconds to die before diff --git a/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc b/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc deleted file mode 100644 index a5446a6188d..00000000000 --- a/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc +++ /dev/null @@ -1,8 +0,0 @@ ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect - ---exec echo "wait" > $_expect_file_name ---shutdown_server ---source include/wait_until_disconnected.inc ---exec echo "restart" > $_expect_file_name ---enable_reconnect ---source include/wait_until_connected_again.inc diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test index 00d8ee73ebc..626364efb99 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test @@ -6,6 +6,6 @@ FLUSH TABLES WITH READ LOCK; CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so'; SELECT * FROM t; ---source include/restart_spider.inc +--source include/restart_mysqld.inc DROP TABLE t; |