[MDEV-13043] Skipped tests ignore warning suppressions Created: 2017-06-09  Updated: 2017-06-12  Resolved: 2017-06-12

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 5.5, 10.0, 10.1, 10.2
Fix Version/s: 10.1.25, 10.2.7, 10.3.1

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Elena Stepanova
Resolution: Fixed Votes: 0
Labels: None


 Description   

When a test is skipped in the middle, all warnings produced by it are considered shutdown-related.

Consider a test case similar to this:

set global log_warnings= 2;
--error 1045
--connect(con1,localhost,foo,,)
set global log_warnings= DEFAULT;
--echo # Finish

Currently it would pass in any tree, because Access denied for user is suppressed globally in MTR; but if we remove that suppression, it would fail like this:

set global log_warnings= 2;
connect(localhost,foo,,test,16000,/data/bld/5.5/mysql-test/var/tmp/mysqld.1.sock);
ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO)
set global log_warnings= DEFAULT;
# Finish
bug.t1                                   [ fail ]  Found warnings/errors in server log file!
        Test ended at 2017-06-09 15:12:47
line
170609 15:12:47 [Warning] Access denied for user 'foo'@'localhost' (using password: NO)
^ Found warnings in /data/bld/5.5/mysql-test/var/log/mysqld.1.err
ok

It's just to imitate a warning not suppressed globally.

Then to fix it, we would need to add a local suppression:

set global log_warnings= 2;
call mtr.add_suppression("Access denied for user");
--error 1045
--connect(con1,localhost,foo,,)
set global log_warnings= DEFAULT;
--echo # Finish

Now it will work all right:

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
set global log_warnings= 2;
call mtr.add_suppression("Access denied for user");
connect(localhost,foo,,test,16000,/data/bld/5.5/mysql-test/var/tmp/mysqld.1.sock);
ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO)
set global log_warnings= DEFAULT;
# Finish
bug.t1                                   [ pass ]      6

However, if the test skips itself in the middle, it doesn't work anymore:

set global log_warnings= 2;
call mtr.add_suppression("Access denied for user");
--error 1045
--connect(con1,localhost,foo,,)
set global log_warnings= DEFAULT;
--skip "Skipped"
--echo # Finish

set global log_warnings= 2;
call mtr.add_suppression("Access denied for user");
connect(localhost,foo,,test,16000,/data/bld/5.5/mysql-test/var/tmp/mysqld.1.sock);
ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO)
set global log_warnings= DEFAULT;
bug.t1                                   [ skipped ]  "Skipped"
***Warnings generated in error logs during shutdown after running tests: bug.t1
 
170609 15:15:57 [Warning] Access denied for user 'foo'@'localhost' (using password: NO)

This is because when a test is skipped, MTR does not perform check_warnings upon the end of test case, and thus all warnings produced during its partial execution are only noticed and registered when the server shuts down.



 Comments   
Comment by Elena Stepanova [ 2017-06-09 ]

https://github.com/MariaDB/server/commit/558bec409ecbaa2a921163d472ca4a33084a72e6

Generated at Thu Feb 08 08:02:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.