Skip to content
Snippets Groups Projects
Commit 927e3516 authored by Andrey Saranchin's avatar Andrey Saranchin Committed by Serge Petrenko
Browse files

test: fix flaky persistent triggers test

The replication test of persistent triggers was waiting only for
the persistent triggers to arrive on replica, so the replica tried
to write to the space which was not created there yet. Let's wait
for all changes to arrive to make the test stable.

Closes #9967

NO_CHANGELOG=test
NO_DOC=test
parent fcf7f5c4
No related branches found
No related tags found
No related merge requests found
......@@ -283,21 +283,16 @@ g.test_replicated_non_idempotent_trigger = function(g)
box.space.weights:replace{'elephant', 4000}
box.space.weights:replace{'crocodile', 600}
end)
-- Wait for the trigger and the space to arrive on the second server
g.server2:wait_for_vclock_of(g.server1)
g.server2:exec(function()
-- Wait for a trigger to arrive
while box.func['example.replicated_trigger'] == nil do
require('fiber').sleep(0)
end
box.space.weights:replace{'cat', 6}
box.space.weights:replace{'dog', 10}
end)
-- Check result
-- Wait for the writes to arrive on the first server
g.server1:wait_for_vclock_of(g.server2)
local check_case = function(expected_result)
-- Wait for both servers
while box.space.weights:count() ~= 4 do
require('fiber').sleep(0)
end
t.assert_equals(box.space.weights:select(nil, {fullscan=true}),
expected_result)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment