Skip to content

Commit

Permalink
test: clean metrics before execution of metrics tests
Browse files Browse the repository at this point in the history
Metrics is now enabled by default. We need to clear it state before
running the appropriate tests to make sure there is no data from
previous tests.

Related to #118
  • Loading branch information
oleg-jukovec committed Jul 11, 2022
1 parent becfc89 commit 8841477
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/unit/metrics_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ g.before_each(function()
t.skip_if(not helpers.is_metrics_supported(),
"metrics >= 0.11.0 is not installed")
g.space = helpers.create_space_with_tree_index('memtx')
-- kill live tasks (it can still live after failed tests)
for _, t in ipairs(expirationd.tasks()) do
expirationd.kill(t)
end
-- disable and clean metrics by default
expirationd.cfg({metrics = false})
require('metrics').clear()
end)

local task = nil
g.after_each(function(g)
expirationd.cfg({metrics = false}) -- reset metrics stats
require('metrics').clear()
expirationd.cfg(g.default_cfg)
g.space:drop()
if task ~= nil then
Expand Down

0 comments on commit 8841477

Please sign in to comment.