Bug #97428 MTR tests failed for main.grant_user_lock
Submitted: 30 Oct 2019 11:29 Modified: 9 Oct 2020 12:28
Reporter: jibin ge Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:8.0.18 OS:Any
Assigned to: CPU Architecture:Any

[30 Oct 2019 11:29] jibin ge
Description:
main.grant_user_lock:
tries to login as anonymous user, but in fact use root@localhost to login.

How to repeat:
./mysql-test-run grant_user_lock

CURRENT_TEST: main.grant_user_lock
mysqltest: At line 115: Query 'connect anonymous_user_con, localhost, '', pass' failed.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Suggested fix:

add a space in connect:
that is, change connect(anonymous_user_con, localhost, '', pass);
to
connect(anonymous_user_con, localhost, ' ', pass);
[30 Oct 2019 11:57] MySQL Verification Team
Thank you for the bug report. I couldn't repeat with most recent source server:

miguel@tikal:~/build/2019OCT14/mysql-8.0/mysql-test$ ./mtr grant_user_lock
Logging: ./mtr  grant_user_lock
MySQL Version 8.0.19
Checking supported features
Using 'all' suites
Collecting tests
Removing old var directory
Creating var directory '/home/miguel/build/2019OCT14/mysql-8.0/mysql-test/var'
Installing system database
Using parallel: 1

==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
[100%] main.grant_user_lock                      [ pass ]  24099
------------------------------------------------------------------------------
The servers were restarted 0 times
The servers were reinitialized 0 times
Spent 24.099 of 85 seconds executing testcases

Completed: All 1 tests were successful.
[30 Oct 2019 12:07] jibin ge
I got the error:
./mysql-test-run grant_user_lock
Logging: ./mysql-test-run  grant_user_lock
MySQL Version 8.0.18
Checking supported features
 - Binaries are debug compiled
Using 'all' suites
Collecting tests
Removing old var directory
Creating var directory '/opt/test/myown/usr/local/mysql/mysql-test/var'
Installing system database
Using parallel: 1

==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
worker[1] mysql-test-run: WARNING: running this script as _root_ will cause some tests to be skipped
[100%] main.grant_user_lock                      [ fail ]
        Test ended at 2019-10-30 18:33:27

CURRENT_TEST: main.grant_user_lock
mysqltest: At line 115: Query 'connect anonymous_user_con, localhost, '', pass' failed.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[30 Oct 2019 12:37] MySQL Verification Team
Not repeatable with most recent source with debug build too:

miguel@tikal:~/buildd/2019OCT14/mysql-8.0/mysql-test$ ./mtr grant_user_lock
Logging: ./mtr  grant_user_lock
MySQL Version 8.0.19
Checking supported features
 - Binaries are debug compiled
Using 'all' suites
Collecting tests
Removing old var directory
Creating var directory '/home/miguel/buildd/2019OCT14/mysql-8.0/mysql-test/var'
Installing system database
Using parallel: 1

==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
[100%] main.grant_user_lock                      [ pass ]  25522
------------------------------------------------------------------------------
The servers were restarted 0 times
The servers were reinitialized 0 times
Spent 25.522 of 103 seconds executing testcases

Completed: All 1 tests were successful.
[30 Oct 2019 16:56] Terje Røsten
Hi!

Are you using root *OS* user (uid 0) to run MTR tests?
[31 Oct 2019 7:06] jibin ge
yes, use root user to run the test case on centos 7.3
[31 Oct 2019 7:58] jibin ge
@Miguel Solorzano

I found the configure option can cause the test case fail, such as 
-DDEFAULT_COLLATION=utf8mb4_unicode_ci, this option cause hundreds of case fail.

I want to know YOUR configure options, could you list them for me?

Thanks!
[31 Oct 2019 8:09] Terje Røsten
Run MTR as root (uid 0) is known to be problematic, please reproduce issue with
a non-privileged user.
[31 Oct 2019 9:07] jibin ge
yes, use mysql to login and test, this case pass!

thansk Terje Røsten!
[31 Oct 2019 10:29] jibin ge
main.mysqladmin case can not pass.  I try to test it by root user or mysql user, but it can not pass! It's a bug or not?

./mysql-test-run main.mysqladmin
Logging: ./mysql-test-run  main.mysqladmin
MySQL Version 8.0.18
Checking supported features
 - Binaries are debug compiled
Using 'all' suites
Collecting tests
Checking leftover processes
Removing old var directory
Creating var directory '/opt/test/myown/usr/local/mysql/mysql-test/var'
Installing system database
Using parallel: 1

==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
[100%] main.mysqladmin                           [ fail ]
        Test ended at 2019-10-31 18:13:18

MTR's internal check of the test case 'main.mysqladmin' failed.
This means that the test case does not preserve the state that existed
before the test case was executed.  Most likely the test case did not
do a proper clean-up. It could also be caused by the previous test run
by this thread, if the server wasn't restarted.
This is the diff of the states of the servers before and after the
test case was executed:
mysqltest: Results saved in '/opt/test/myown/usr/local/mysql/mysql-test/var/tmp/check-mysqld_1.result'.
mysqltest: Logging to '/opt/test/myown/usr/local/mysql/mysql-test/var/tmp/check-mysqld_1.log'.
mysqltest: Connecting to server localhost:13020 (socket /opt/test/myown/usr/local/mysql/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ...
mysqltest: ... Connected.
mysqltest: Start processing test commands from './include/check-testcase.test' ...
mysqltest: ... Done processing test commands.
--- /opt/test/myown/usr/local/mysql/mysql-test/var/tmp/check-mysqld_1.result	2019-10-31 13:13:15.043810102 +0300
+++ /opt/test/myown/usr/local/mysql/mysql-test/var/tmp/check-mysqld_1.reject	2019-10-31 13:13:17.921049238 +0300
@@ -71,6 +71,7 @@
 #-------------- MYSQLTEST_VARDIR/run --------------
 mysqld.1.pid
 #-------------- MYSQLTEST_VARDIR/tmp --------------
+.mylogin.cnf
 mysqld.1
[31 Oct 2019 11:27] MySQL Verification Team
It's a bug, file a new bug report for:

miguel@tikal:~/build/2019OCT14/mysql-8.0/mysql-test$ ./mtr main.mysqladmin
Logging: ./mtr  main.mysqladmin
MySQL Version 8.0.19
Checking supported features
Using 'all' suites
Collecting tests
Checking leftover processes
Removing old var directory
Creating var directory '/home/miguel/build/2019OCT14/mysql-8.0/mysql-test/var'
Installing system database
Using parallel: 1

==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
[100%] main.mysqladmin                           [ fail ]
        Test ended at 2019-10-31 08:24:06

<CUT>
[31 Oct 2019 11:38] Terje Røsten
Has user running MTR a ~/.mylogin.cnf present? 

That might confuse test.
[31 Oct 2019 11:49] MySQL Verification Team
No on my case.
[31 Oct 2019 12:18] jibin ge
I can not find the file "mylogin.cnf" on the machine.

find / -name "mylogin*"
/opt/test/mysql8018/usr/local/mysql/mysql-test/std_data/mylogin-bad-cipher.cnf
/opt/test/mysql8018/usr/local/mysql/mysql-test/var/std_data/mylogin-bad-cipher.cnf
[1 Nov 2019 7:24] jibin ge
I found 2 case can not pass (the test is not big test),  one is main.mysqladmin, 
another is binlog.binlog_rewrite_order.

./mysql-test-run binlog.binlog_rewrite_order

Logging: ./mysql-test-run  binlog.binlog_rewrite_order
MySQL Version 8.0.18
Checking supported features
 - Binaries are debug compiled
Using 'all' suites
Collecting tests
 - Adding combinations for binlog
Checking leftover processes
Removing old var directory
Creating var directory '/opt/test/simple/usr/local/mysql/mysql-test/var'
Installing system database
Using parallel: 1

==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
[ 33%] binlog.binlog_rewrite_order 'mix'         [ fail ]
        Test ended at 2019-11-01 12:03:26

MTR's internal check of the test case 'binlog.binlog_rewrite_order' failed.
This means that the test case does not preserve the state that existed
before the test case was executed.  Most likely the test case did not
do a proper clean-up. It could also be caused by the previous test run
by this thread, if the server wasn't restarted.
This is the diff of the states of the servers before and after the
test case was executed:
mysqltest: Results saved in '/opt/test/simple/usr/local/mysql/mysql-test/var/tmp/check-mysqld_1.result'.
mysqltest: Logging to '/opt/test/simple/usr/local/mysql/mysql-test/var/tmp/check-mysqld_1.log'.
mysqltest: Connecting to server localhost:13000 (socket /opt/test/simple/usr/local/mysql/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ...
mysqltest: ... Connected.
mysqltest: Start processing test commands from './include/check-testcase.test' ...
mysqltest: ... Done processing test commands.
--- /opt/test/simple/usr/local/mysql/mysql-test/var/tmp/check-mysqld_1.result	2019-11-01 07:03:20.234366269 +0300
+++ /opt/test/simple/usr/local/mysql/mysql-test/var/tmp/check-mysqld_1.reject	2019-11-01 07:03:26.713916925 +0300
@@ -71,6 +71,15 @@
 #-------------- MYSQLTEST_VARDIR/run --------------
 mysqld.1.pid
 #-------------- MYSQLTEST_VARDIR/tmp --------------
+SQL_LOAD_MB-1-0
+SQL_LOAD_MB-1-1
+SQL_LOAD_MB-1-2
+SQL_LOAD_MB-2-0
+SQL_LOAD_MB-2-1
+SQL_LOAD_MB-2-2
+SQL_LOAD_MB-3-0
+SQL_LOAD_MB-3-1
+SQL_LOAD_MB-3-2
 mysqld.1
 #------------- MYSQLTEST_VARDIR/std_data ------------