diff --git a/test/helper.lua b/test/helper.lua index ededa70c..30763c45 100644 --- a/test/helper.lua +++ b/test/helper.lua @@ -553,4 +553,18 @@ function helpers.complement_tuples_batch_with_operations(tuples, operations) return tuples_operation_data end +function helpers.is_metrics_0_12_0_or_older() + local metrics = require('metrics') + + -- metrics 0.13.0 introduced VERSION, but it is likely to be deprecated in the future: + -- https://github.com/tarantool/metrics/commit/a7e666f50d23c3e1a11b9bc9882edddec2f4c67e + -- metrics 0.16.0 introduced _VERSION which is likely going to replace VERSION: + -- https://github.com/tarantool/metrics/commit/8f9b667f9db59ceff8e5d26e458244e2d67838da + if (metrics.VERSION == nil) and metrics._VERSION == nil then + return true + end + + return false +end + return helpers diff --git a/test/integration/stats_test.lua b/test/integration/stats_test.lua index 0553f93e..12f90dfc 100644 --- a/test/integration/stats_test.lua +++ b/test/integration/stats_test.lua @@ -772,7 +772,8 @@ pgroup.before_test( generate_stats) pgroup.test_role_reload_do_not_reset_observations = function(g) - t.xfail_if(g.params.args.driver == 'metrics', + t.skip_if((g.params.args.driver == 'metrics') + and helpers.is_metrics_0_12_0_or_older(), 'See https://github.com/tarantool/metrics/issues/334') local stats_before = get_stats(g) @@ -1084,7 +1085,8 @@ group_metrics.before_test( generate_stats) group_metrics.test_role_reload_do_not_reset_metrics_observations = function(g) - t.xfail('See https://github.com/tarantool/metrics/issues/334') + t.skip_if(helpers.is_metrics_0_12_0_or_older(), + "See https://github.com/tarantool/metrics/issues/334") helpers.reload_roles(g.cluster:server('router')) g.router:eval("crud = require('crud')")