Bug #113023 mysql-test/include/wait_for_pattern_in_file.inc incompatible with Homebrew Perl
Submitted: 9 Nov 2023 12:52 Modified: 17 Oct 14:01
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:8.0 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: brew, homebrew, mtr, perl

[9 Nov 2023 12:52] Laurynas Biveinis
Description:
If Perl from Homebrew is installed & used, the testcases that use mysql-test/include/wait_for_pattern_in_file.inc hang indefinitely even though the search pattern does appear:

[ 50%] binlog_gtid.binlog_gtid_binlog_recovery_errors 'row'  [ fail ]  timeout after 900 seconds
        Test ended at 2023-11-09 14:28:24

Test case timeout after 900 seconds

mysqltest: At line 36: perl
In included file ./include/wait_for_pattern_in_file.inc: 70
included from /Users/laurynas/vilniusdb/mysql-8.0.35/mysql-test/suite/binlog_gtid/t/binlog_gtid_binlog_recovery_errors.test: 258

== /Users/laurynas/vilniusdb/mysql-8.0.35/_build-debug/mysql-test/var/log/binlog_gtid_binlog_recovery_errors.log == 
include/suppress_messages.inc
# Connection 1 suppresses message <.*Found invalid event sequence while recovering from binary log file.*>.
# Connection 1 suppresses message <.*Found.*prepared XA transactions.*>.
# Connection 1 suppresses message <.*Can.t init tc log.*>.
# Connection 1 suppresses message <.*Aborting.*>.
CREATE TABLE t1 (c1 INT PRIMARY KEY);
RESET MASTER;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
extra/binlog_tests/recovery/kill_copy_malformed_restart.inc [orphan_xid]
# Kill the server
# restart: --debug=+d,eval_force_bin_log_recovery
include/wait_for_removed_expect_file.inc
include/wait_for_pattern_in_file.inc [.*between positions 430 and 540: Xid_log_event outside the boundary of a sequence of events representing an active transaction.*]

How to repeat:
$ ./mysql-test-run binlog_gtid.binlog_gtid_binlog_recovery_errors
...
[ 25%] binlog_gtid.binlog_gtid_binlog_recovery_errors 'mix'  [ skipped ]  Doesn't support --binlog-format = 'mixed'
[ 50%] binlog_gtid.binlog_gtid_binlog_recovery_errors 'row'  [ pass ]  77666
[ 75%] binlog_gtid.binlog_gtid_binlog_recovery_errors 'stmt'  [ skipped ]  Doesn't support --binlog-format = 'statement'
...
$ brew install perl
$ export PATH=/opt/homebrew/bin:$PATH # Adjust as needed if on Intel Mac
# Rebuild MySQL or otherwise fix because the hardcoded Perl path in mtr shebang in the build dir scripts
$ ./mysql-test-run binlog_gtid.binlog_gtid_binlog_recovery_errors
... output from the above ...
[9 Nov 2023 13:34] MySQL Verification Team
Hi Mr. Biveinis,

Thank you for your bug report.

When we use Perl from the /usr/bin/ directory which is:

----------------
This is perl 5, version 30, subversion 3 (v5.30.3) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

Copyright 1987-2020, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
-------------

we get straight output for that test.

However, when we used perl from Cellar, which is the following version:

-----------------

This is perl 5, version 38, subversion 0 (v5.38.0) built for darwin-thread-multi-2level

Copyright 1987-2023, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.

----------------

we get the following output:

-------------------------------------
MySQL Version 8.2.0
Checking supported features
 - Binaries are debug compiled
Using 'all' suites
Collecting tests
 - Adding combinations for binlog_gtid
Removing old var directory
Creating var directory '/Users/sinisa/razno/work/repo/mysql-8.1.0/debug/mysql-test/var'
Installing system database
Using parallel: 1

==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
[ 25%] binlog_gtid.binlog_gtid_binlog_recovery_errors 'mix'  [ skipped ]  Doesn't support --binlog-format = 'mixed'
-------------------------------------

and then we waited for 20 minutes and killed it.

We repeated the same in 8.0 and 8.1. 

With exactly the same result.

This affects test cases in 8.0, 8.1 and 8.2.

Verified as reported.
[2 Jul 4:19] Laurynas Biveinis
Same on 8.0.38
[2 Jul 9:22] MySQL Verification Team
Thank you Mr. Biveinis.

We can confirm that this is true.

However, versions is still 8.0.

8.0.38 is not a version it is a bug fix release of the version 8.0.
[3 Jul 4:29] Laurynas Biveinis
Not sure how then the version field would work for bugs are introduced, are fixed, regress, etc. all in a single series
[3 Jul 9:27] MySQL Verification Team
Hi Mr. Biveinis,

This is not due to the new features, but due to the patches made to fix bugs.
[17 Oct 12:43] Laurynas Biveinis
No longer reproduces under 8.0.40 / 8.4.3 / 9.1.0
[17 Oct 14:01] MySQL Verification Team
Thank you Mr. Biveinis,

This bug report is now closed.