The culprit is actually feedback_plugin_load test. It queries I_S.FEEDBACK table, and every time the table is queried, 'FEEDBACK used' is increased.
feedback_plugin_load normally requires server restart before execution, so its first execution goes fine, 'FEEDBACK used' = 1.
If the next test in line is feedback_plugin_send, it sources feedback_plugin_load again, so the select returns 'FEEDBACK used' = 2, as recorded in feedback_plugin_send.result.
However, if we execute feedback_plugin_send.test separately, there are no previous selects from I_S.FEEDBACK, so the value is lower.
Or, if we execute feedback_plugin_load more than once, e.g. with --repeat, the 2nd and further runs will fail, because there 'FEEDBACK used' will be greater than 1.
The solution should be either to mask the value, or check that it increases without recording the actual value. I will go with the latter.
Elena Stepanova
added a comment - The culprit is actually feedback_plugin_load test. It queries I_S.FEEDBACK table, and every time the table is queried, 'FEEDBACK used' is increased.
feedback_plugin_load normally requires server restart before execution, so its first execution goes fine, 'FEEDBACK used' = 1.
If the next test in line is feedback_plugin_send, it sources feedback_plugin_load again, so the select returns 'FEEDBACK used' = 2, as recorded in feedback_plugin_send.result.
However, if we execute feedback_plugin_send.test separately, there are no previous selects from I_S.FEEDBACK, so the value is lower.
Or, if we execute feedback_plugin_load more than once, e.g. with --repeat, the 2nd and further runs will fail, because there 'FEEDBACK used' will be greater than 1.
The solution should be either to mask the value, or check that it increases without recording the actual value. I will go with the latter.
@@ -4,7 +4,24 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'fe
}
select plugin_status from information_schema.plugins where plugin_name='feedback';
+
+# Every SELECT from INFORMATION_SCHEMA.FEEDBACK increases the value of 'FEEDBACK used'.
+# We cannot record the actual value, because the test can be executed more than once,
+# but we can check that the value indeed increases as expected.
+# There is still a room for some race condition, e.g. if at the very moment
+# between first SELECT to store the value and the next SELECT to check that it increases,
+# the feedback plugin is activated. But the probability of it is close to 0,
+# so lets get back to it if it ever happens.
+
+# Lets say the plugin was used X times before this SELECT
+SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+
+# Now $feedback_used == X+1, and 'FEEDBACK used' is also X+1. And variable_value is increased again when we run the next SELECT
+SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+
+# Now when we are happy with 'FEEDBACK used', we can check everything else
+
--replace_result https http
--sorted_result
select * from information_schema.feedback where variable_name like 'feed%'
- and variable_name not like '%_uid';
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
Elena Stepanova
added a comment - serg , please check if you are okay with this.
Commit mailing list seems to be down, so here is the patch:
commit bdcf37076595b003d74edc6a23c53ac23fba64a8
Author: Elena Stepanova <elenst@montyprogram.com>
Date: Sun Sep 27 16:00:48 2015 +0300
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.
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result
index 443b91b..ea6eae9 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_load.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result
@@ -1,10 +1,13 @@
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
+SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+variable_value = @feedback_used + 1
+1
select * from information_schema.feedback where variable_name like 'feed%'
- and variable_name not like '%_uid';
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
VARIABLE_NAME VARIABLE_VALUE
-FEEDBACK used 1
FEEDBACK version 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result
index 2852240..90a37f7 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_send.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result
@@ -1,10 +1,13 @@
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
+SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+variable_value = @feedback_used + 1
+1
select * from information_schema.feedback where variable_name like 'feed%'
- and variable_name not like '%_uid';
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
VARIABLE_NAME VARIABLE_VALUE
-FEEDBACK used 2
FEEDBACK version 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
diff --git a/mysql-test/suite/plugins/t/feedback_plugin_load.test b/mysql-test/suite/plugins/t/feedback_plugin_load.test
index 5ad3016..f7c62b9 100644
--- a/mysql-test/suite/plugins/t/feedback_plugin_load.test
+++ b/mysql-test/suite/plugins/t/feedback_plugin_load.test
@@ -4,7 +4,24 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'fe
}
select plugin_status from information_schema.plugins where plugin_name='feedback';
+
+# Every SELECT from INFORMATION_SCHEMA.FEEDBACK increases the value of 'FEEDBACK used'.
+# We cannot record the actual value, because the test can be executed more than once,
+# but we can check that the value indeed increases as expected.
+# There is still a room for some race condition, e.g. if at the very moment
+# between first SELECT to store the value and the next SELECT to check that it increases,
+# the feedback plugin is activated. But the probability of it is close to 0,
+# so lets get back to it if it ever happens.
+
+# Lets say the plugin was used X times before this SELECT
+SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+
+# Now $feedback_used == X+1, and 'FEEDBACK used' is also X+1. And variable_value is increased again when we run the next SELECT
+SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
+
+# Now when we are happy with 'FEEDBACK used', we can check everything else
+
--replace_result https http
--sorted_result
select * from information_schema.feedback where variable_name like 'feed%'
- and variable_name not like '%_uid';
+ and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used';
[ Thinking about it, it's probably not worth reviewing. The change should do the job, for example to allow the test to pass when it's retried by buildbot, and otherwise nobody really cares about it, so I'll push it and see how it goes.
]
Thinking about it, it's probably not worth reviewing. The change should do the job, for example to allow the test to pass when it's retried by buildbot, and otherwise nobody really cares about it, so I'll push it and see how it goes.
Elena Stepanova
added a comment - Thinking about it, it's probably not worth reviewing. The change should do the job, for example to allow the test to pass when it's retried by buildbot, and otherwise nobody really cares about it, so I'll push it and see how it goes.
The culprit is actually feedback_plugin_load test. It queries I_S.FEEDBACK table, and every time the table is queried, 'FEEDBACK used' is increased.
feedback_plugin_load normally requires server restart before execution, so its first execution goes fine, 'FEEDBACK used' = 1.
If the next test in line is feedback_plugin_send, it sources feedback_plugin_load again, so the select returns 'FEEDBACK used' = 2, as recorded in feedback_plugin_send.result.
However, if we execute feedback_plugin_send.test separately, there are no previous selects from I_S.FEEDBACK, so the value is lower.
Or, if we execute feedback_plugin_load more than once, e.g. with --repeat, the 2nd and further runs will fail, because there 'FEEDBACK used' will be greater than 1.
The solution should be either to mask the value, or check that it increases without recording the actual value. I will go with the latter.