Skip to content

Commit bdcf370

Browse files
committed
MDEV-7933 plugins.feedback_plugin_send depends on being executed after plugins.feedback_plugin_load
The culprit is the feedback_plugin_load test, which is run both separately and from inside feedback_plugin_send.test. The test queries I_S.FEEDBACK, and every time it does, 'FEEDBACK used' value is increased. Fixed by checking that the value is increased instead of recording the actual value in the result file.
1 parent 2563609 commit bdcf370

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

mysql-test/suite/plugins/r/feedback_plugin_load.result

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
select plugin_status from information_schema.plugins where plugin_name='feedback';
22
plugin_status
33
ACTIVE
4+
SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
5+
SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
6+
variable_value = @feedback_used + 1
7+
1
48
select * from information_schema.feedback where variable_name like 'feed%'
5-
and variable_name not like '%_uid';
9+
and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
610
VARIABLE_NAME VARIABLE_VALUE
7-
FEEDBACK used 1
811
FEEDBACK version 1.1
912
FEEDBACK_SEND_RETRY_WAIT 60
1013
FEEDBACK_SEND_TIMEOUT 60

mysql-test/suite/plugins/r/feedback_plugin_send.result

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
select plugin_status from information_schema.plugins where plugin_name='feedback';
22
plugin_status
33
ACTIVE
4+
SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
5+
SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
6+
variable_value = @feedback_used + 1
7+
1
48
select * from information_schema.feedback where variable_name like 'feed%'
5-
and variable_name not like '%_uid';
9+
and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
610
VARIABLE_NAME VARIABLE_VALUE
7-
FEEDBACK used 2
811
FEEDBACK version 1.1
912
FEEDBACK_SEND_RETRY_WAIT 60
1013
FEEDBACK_SEND_TIMEOUT 60

mysql-test/suite/plugins/t/feedback_plugin_load.test

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'fe
44
}
55

66
select plugin_status from information_schema.plugins where plugin_name='feedback';
7+
8+
# Every SELECT from INFORMATION_SCHEMA.FEEDBACK increases the value of 'FEEDBACK used'.
9+
# We cannot record the actual value, because the test can be executed more than once,
10+
# but we can check that the value indeed increases as expected.
11+
# There is still a room for some race condition, e.g. if at the very moment
12+
# between first SELECT to store the value and the next SELECT to check that it increases,
13+
# the feedback plugin is activated. But the probability of it is close to 0,
14+
# so lets get back to it if it ever happens.
15+
16+
# Lets say the plugin was used X times before this SELECT
17+
SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
18+
19+
# Now $feedback_used == X+1, and 'FEEDBACK used' is also X+1. And variable_value is increased again when we run the next SELECT
20+
SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
21+
22+
# Now when we are happy with 'FEEDBACK used', we can check everything else
23+
724
--replace_result https http
825
--sorted_result
926
select * from information_schema.feedback where variable_name like 'feed%'
10-
and variable_name not like '%_uid';
27+
and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';

0 commit comments

Comments
 (0)