Skip to content

Commit

Permalink
MDEV-31953 fixup: Clean up the test
Browse files Browse the repository at this point in the history
Let us tolerate multiple "Memory pressure event freed"
in case there a real memory pressure event occurred
in addition to the one that this test simulates.
Also, clean up some SET variables.
  • Loading branch information
dr-m committed Nov 20, 2023
1 parent 90d968d commit 3ba041f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 4 additions & 6 deletions mysql-test/suite/innodb/r/mem_pressure.result
Expand Up @@ -3,14 +3,12 @@
#
set @save_dbug=@@debug_dbug;
set @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
set @save_lag_wait=@@GLOBAL.innodb_max_purge_lag_wait;
set GLOBAL innodb_max_purge_lag_wait=0;
CREATE TABLE t1 (t TEXT) ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET unique_checks=0, foreign_key_checks=0;
INSERT INTO t1 SELECT CONCAT(REPEAT('junk text', 500), CAST(seq AS CHAR)) FROM seq_1_to_1000;
SET STATEMENT unique_checks=0, foreign_key_checks=0 FOR
INSERT INTO t1 SELECT * FROM seq_1_to_1000;
SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
SET GLOBAL innodb_max_purge_lag_wait=@save_lag_wait;
DROP TABLE t1;
SELECT CAST(VARIABLE_VALUE AS INTEGER) INTO @dirty_prev
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
Expand All @@ -22,6 +20,6 @@ FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
LESS_DIRTY_IS_GOOD
1
FOUND 1 /InnoDB: Memory pressure event freed/ in mysqld.1.err
FOUND 1 /InnoDB: Memory pressure event freed.*/ in mysqld.1.err
set debug_dbug=@save_dbug;
# End of 10.11 tests
12 changes: 6 additions & 6 deletions mysql-test/suite/innodb/t/mem_pressure.test
Expand Up @@ -11,16 +11,16 @@
set @save_dbug=@@debug_dbug;

set @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
set @save_lag_wait=@@GLOBAL.innodb_max_purge_lag_wait;
# Wait for the undo logs to be empty from previous tests.
# This is not an actual parameter, so there is no need to restore it.
set GLOBAL innodb_max_purge_lag_wait=0;

CREATE TABLE t1 (t TEXT) ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET unique_checks=0, foreign_key_checks=0;
INSERT INTO t1 SELECT CONCAT(REPEAT('junk text', 500), CAST(seq AS CHAR)) FROM seq_1_to_1000;
SET STATEMENT unique_checks=0, foreign_key_checks=0 FOR
INSERT INTO t1 SELECT * FROM seq_1_to_1000;

SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
SET GLOBAL innodb_max_purge_lag_wait=@save_lag_wait;

DROP TABLE t1;

Expand All @@ -36,7 +36,7 @@ FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';

let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN= InnoDB: Memory pressure event freed;
let SEARCH_PATTERN= InnoDB: Memory pressure event freed.*;
--source include/search_pattern_in_file.inc

set debug_dbug=@save_dbug;
Expand Down

0 comments on commit 3ba041f

Please sign in to comment.