Skip to content

Commit dd4dd73

Browse files
committed
PS-11291 [8.4] Telemetry tests failing on MacOS
Fix: - using MTR commands (OS independant) instead of OS commands in tests - extracting OS specific part from expected error messages
1 parent 24800f2 commit dd4dd73

8 files changed

Lines changed: 32 additions & 24 deletions

File tree

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
CALL mtr.add_suppression("Component percona_telemetry reported: 'Skipping file deletion this_file_should_not_be_removed'");
22
# restart:--percona_telemetry.grace_interval=30 --percona_telemetry.scrape_interval=30 --percona_telemetry.history_keep_interval=80 --percona_telemetry.telemetry_root_dir=<telemetry_root_dir>
33
File with the name not conforming to the pattern still should be there
4-
1
5-
Obsolete file should be removed
6-
0
4+
Obsolete file should be removed (the below command returns nothing)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# restart:--percona_telemetry.grace_interval=30 --percona_telemetry.scrape_interval=30 --percona_telemetry.history_keep_interval=80 --percona_telemetry.telemetry_root_dir=<telemetry_root_dir>
22
Server should still be alive
3-
CALL mtr.add_suppression("Component percona_telemetry reported: 'Problem during telemetry file write: filesystem error: directory iterator cannot open directory: No such file or directory");
3+
CALL mtr.add_suppression("Component percona_telemetry reported: 'Problem during telemetry file write: filesystem error:");
44
include/assert_grep.inc [Percona Telemetry Component warns about nonexistent directory]
55
Telemetry root dir should contain 1 file
6-
1
6+
XXX.json

mysql-test/suite/component_percona_telemetry/r/no_user.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Warnings:
77
Warning 4005 User 'root'@'localhost' is referenced as a definer account in a stored routine.
88
Warning 4005 User 'root'@'localhost' is referenced as a definer account in a trigger.
99
'root' user used by component's 1st verison does not exist. Telemetry dir should contain 1 file.
10-
1
10+
XXX.json
1111
RENAME USER 'root.tmp'@'localhost' to 'root'@'localhost';
1212
Warnings:
1313
Warning 4005 User 'root'@'localhost' is referenced as a definer account in a stored routine.
@@ -16,7 +16,7 @@ Warning 4005 User 'root'@'localhost' is referenced as a definer account in a tri
1616
RENAME USER 'percona.telemetry'@'localhost' to 'percona.telemetry.tmp'@'localhost';
1717
include/assert.inc [No orphaned sessions expected in processlist]
1818
'percona.telemetry' user used by component does not exist. Telemetry dir should still contain 1 file.
19-
1
19+
XXX.json
2020
RENAME USER 'percona.telemetry.tmp'@'localhost' to 'percona.telemetry'@'localhost';
2121
# restart:--percona_telemetry.grace_interval=30 --percona_telemetry.scrape_interval=30 --percona_telemetry.telemetry_root_dir=<telemetry_root_dir>
2222
DROP USER 'percona.telemetry'@'localhost';
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# restart:--percona_telemetry.grace_interval=30 --percona_telemetry.scrape_interval=30 --percona_telemetry.history_keep_interval=80 --percona_telemetry.telemetry_root_dir=<telemetry_root_dir>
22
Time passed: 10.0000. Still in grace_interval. Telemetry root dir should contain 0 files
3-
0
43
Time passed: 40.0000. Time after grace_interval: 10.0000. Telemetry root dir should contain 1 file
5-
1
4+
XXX.json
65
Time passed: 70.0000. Time after grace_interval: 40.0000. Telemetry root dir should contain 2 files
7-
2
6+
XXX.json
7+
XXX.json
88
Time passed: 100.0000. Time after grace_interval: 70.0000. Telemetry root dir should contain 3 files
9-
3
9+
XXX.json
10+
XXX.json
11+
XXX.json
1012
Time passed: 130.0000. Time after grace_interval: 100.0000. Telemetry root dir should still contain 3 files
11-
3
13+
XXX.json
14+
XXX.json
15+
XXX.json

mysql-test/suite/component_percona_telemetry/t/delete_obsolete_file.test

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ CALL mtr.add_suppression("Component percona_telemetry reported: 'Skipping file d
3131

3232
--echo File with the name not conforming to the pattern still should be there
3333
--file_exists $untouchable_file
34-
--exec ls -1 $telemetry_root_dir | grep $untouchable_file_name | wc -l
3534

36-
--echo Obsolete file should be removed
37-
--exec ls -1 $telemetry_root_dir | grep $obsolete_file_name | wc -l
35+
--echo Obsolete file should be removed (the below command returns nothing)
36+
--list_files $telemetry_root_dir $obsolete_file_name
3837

3938
# cleanup
4039
--force-rmdir $telemetry_root_dir

mysql-test/suite/component_percona_telemetry/t/invalid_path.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
--sleep $timeout
2222
--echo Server should still be alive
2323

24-
--let $warning_message = Component percona_telemetry reported: 'Problem during telemetry file write: filesystem error: directory iterator cannot open directory: No such file or directory
24+
--let $warning_message = Component percona_telemetry reported: 'Problem during telemetry file write: filesystem error:
2525
--eval CALL mtr.add_suppression("$warning_message")
2626
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
2727
--let $assert_select = $warning_message
@@ -36,7 +36,8 @@
3636
--let $timeout = $scrape_interval
3737
--sleep $timeout
3838
--echo Telemetry root dir should contain 1 file
39-
--exec ls -1 $telemetry_root_dir | wc -l
39+
--replace_regex /.+\.json/XXX.json/
40+
--list_files $telemetry_root_dir
4041

4142
# cleanup
4243
--force-rmdir $telemetry_root_dir

mysql-test/suite/component_percona_telemetry/t/no_user.test

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ RENAME USER 'root'@'localhost' to 'root.tmp'@'localhost';
3131
--sleep $timeout
3232

3333
--echo 'root' user used by component's 1st verison does not exist. Telemetry dir should contain 1 file.
34-
--exec ls -1 $telemetry_root_dir | wc -l
34+
--replace_regex /.+\.json/XXX.json/
35+
--list_files $telemetry_root_dir
3536

3637
#
3738
# It should be possible to restart the server.
@@ -57,7 +58,8 @@ RENAME USER 'percona.telemetry'@'localhost' to 'percona.telemetry.tmp'@'localhos
5758

5859
# Check that no new telemetry file was created
5960
--echo 'percona.telemetry' user used by component does not exist. Telemetry dir should still contain 1 file.
60-
--exec ls -1 $telemetry_root_dir | wc -l
61+
--replace_regex /.+\.json/XXX.json/
62+
--list_files $telemetry_root_dir
6163

6264

6365
#

mysql-test/suite/component_percona_telemetry/t/telemetry_file_creation.test

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
### now we are withing grace_interval
2727
--echo Time passed: $time_passed. Still in grace_interval. Telemetry root dir should contain 0 files
28-
--exec ls -1 $telemetry_root_dir | wc -l
28+
--list_files $telemetry_root_dir
2929

3030

3131

@@ -37,7 +37,8 @@
3737

3838
### now we are in 1st scrape interval
3939
--echo Time passed: $time_passed. Time after grace_interval: $time_after_grace_interval. Telemetry root dir should contain 1 file
40-
--exec ls -1 $telemetry_root_dir | wc -l
40+
--replace_regex /.+\.json/XXX.json/
41+
--list_files $telemetry_root_dir
4142

4243

4344

@@ -49,7 +50,8 @@
4950

5051
### now we are in 2nd scrape interval
5152
--echo Time passed: $time_passed. Time after grace_interval: $time_after_grace_interval. Telemetry root dir should contain 2 files
52-
--exec ls -1 $telemetry_root_dir | wc -l
53+
--replace_regex /.+\.json/XXX.json/
54+
--list_files $telemetry_root_dir
5355

5456

5557
# Wait a bit more. New telemetry file should be created
@@ -60,7 +62,8 @@
6062

6163
### now we are in 3rd scrape interval
6264
--echo Time passed: $time_passed. Time after grace_interval: $time_after_grace_interval. Telemetry root dir should contain 3 files
63-
--exec ls -1 $telemetry_root_dir | wc -l
65+
--replace_regex /.+\.json/XXX.json/
66+
--list_files $telemetry_root_dir
6467

6568

6669
# Due to history_keep_interval, new files should be created, but old ones should be deleted.
@@ -70,7 +73,8 @@
7073
--let $time_after_grace_interval = `select $time_passed - $grace_interval`
7174

7275
--echo Time passed: $time_passed. Time after grace_interval: $time_after_grace_interval. Telemetry root dir should still contain 3 files
73-
--exec ls -1 $telemetry_root_dir | wc -l
76+
--replace_regex /.+\.json/XXX.json/
77+
--list_files $telemetry_root_dir
7478

7579
# cleanup
7680
--force-rmdir $telemetry_root_dir

0 commit comments

Comments
 (0)