Skip to content

Backport storage-alerts #544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/luatest_helpers/asserts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ function asserts:wait_fullmesh(servers, wait_time)
end)
end

function asserts:assert_server_no_alerts(server)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire file seems dead in vshard. I propose to

  • Drop test/luatest_helpers/asserts.lua.
  • Your new assertion better be added to test/luatest_helpers/server.lua. As a server's method. You even take the server as an argument here. So it makes sense to make it a server's method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, doesn't seem fixed. I still see this file and its usage.

server:exec(function()
ilt.assert_equals(ivshard.storage.info().alerts, {})
end)
end

return asserts
13 changes: 4 additions & 9 deletions test/storage-luatest/persistent_names_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local t = require('luatest')
local vtest = require('test.luatest_helpers.vtest')
local server = require('test.luatest_helpers.server')
local vutil = require('vshard.util')
local asserts = require('test.luatest_helpers.asserts')

local test_group = t.group('storage')

Expand Down Expand Up @@ -125,20 +126,14 @@ local function persistent_names_restore(g, names)
end
end

local function storage_assert_no_alerts(instance)
instance:exec(function()
ilt.assert_equals(ivshard.storage.info().alerts, {})
end)
end

--
-- vshard throwed unrelevant UNREACHABLE_REPLICA warning, when names are
-- not set and `name_as_key` identification_mode is used.
--
test_group.test_no_unreachable_replica_alert = function(g)
local names = persistent_names_remove(g)
storage_assert_no_alerts(g.replica_1_a)
storage_assert_no_alerts(g.replica_2_a)
asserts:assert_server_no_alerts(g.replica_1_a)
asserts:assert_server_no_alerts(g.replica_2_a)
persistent_names_restore(g, names)
end

Expand All @@ -164,5 +159,5 @@ test_group.test_id_is_shown_in_alerts = function(g)
g.replica_1_a:exec(function(id)
box.space._cluster:delete(id)
end, {id})
storage_assert_no_alerts(g.replica_1_a)
asserts:assert_server_no_alerts(g.replica_1_a)
end