Skip to content
Snippets Groups Projects
Commit 3f5806ab authored by Georgy Kirichenko's avatar Georgy Kirichenko Committed by Vladimir Davydov
Browse files

test: fix flaky test

This test fails sporadically
parent 0529e2f0
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ function fill()
box.space.test:replace{i}
end
fiber.create(function()
box.error.injection.set('ERRINJ_RELAY_TIMEOUT', 0.1)
box.error.injection.set('ERRINJ_RELAY_TIMEOUT', 0.0025)
test_run:wait_cond(function()
local r = box.info.replication[2]
return r ~= nil and r.downstream ~= nil and
......@@ -55,7 +55,6 @@ function fill()
for i = count + 101, count + 200 do
box.space.test:replace{i}
end
box.error.injection.set('ERRINJ_RELAY_TIMEOUT', 0)
end)
count = count + 200
end;
......@@ -250,6 +249,10 @@ test_run:cmd("switch default")
---
- true
...
box.error.injection.set('ERRINJ_RELAY_TIMEOUT', 0)
---
- ok
...
box.error.injection.set('ERRINJ_WAL_DELAY', true)
---
- ok
......
......@@ -30,7 +30,7 @@ function fill()
box.space.test:replace{i}
end
fiber.create(function()
box.error.injection.set('ERRINJ_RELAY_TIMEOUT', 0.1)
box.error.injection.set('ERRINJ_RELAY_TIMEOUT', 0.0025)
test_run:wait_cond(function()
local r = box.info.replication[2]
return r ~= nil and r.downstream ~= nil and
......@@ -39,7 +39,6 @@ function fill()
for i = count + 101, count + 200 do
box.space.test:replace{i}
end
box.error.injection.set('ERRINJ_RELAY_TIMEOUT', 0)
end)
count = count + 200
end;
......@@ -136,6 +135,7 @@ box.cfg{replication_sync_lag = 1}
box.cfg{replication_sync_timeout = 10}
test_run:cmd("switch default")
box.error.injection.set('ERRINJ_RELAY_TIMEOUT', 0)
box.error.injection.set('ERRINJ_WAL_DELAY', true)
test_run:cmd("setopt delimiter ';'")
_ = fiber.create(function()
......
......@@ -7,12 +7,21 @@ test_run = env.new()
box.schema.user.grant('guest', 'replication')
---
...
s = box.schema.space.create('test', {engine = test_run:get_cfg('engine')})
engine = test_run:get_cfg('engine')
---
...
s = box.schema.space.create('test', {engine = engine})
---
...
_ = s:create_index('pk')
---
...
l = box.schema.space.create('l_space', {engine = engine, is_local = true})
---
...
_ = l:create_index('pk')
---
...
-- transaction w/o conflict
box.begin() s:insert({1, 'm'}) s:insert({2, 'm'}) box.commit()
---
......@@ -92,6 +101,11 @@ box.cfg{replication = replication}
---
...
-- replication stopped of third transaction
-- flush wal
box.space.l_space:replace({1})
---
- [1]
...
v1[1] + 2 == box.info.vclock[1]
---
- true
......
env = require('test_run')
test_run = env.new()
box.schema.user.grant('guest', 'replication')
engine = test_run:get_cfg('engine')
s = box.schema.space.create('test', {engine = test_run:get_cfg('engine')})
s = box.schema.space.create('test', {engine = engine})
_ = s:create_index('pk')
l = box.schema.space.create('l_space', {engine = engine, is_local = true})
_ = l:create_index('pk')
-- transaction w/o conflict
box.begin() s:insert({1, 'm'}) s:insert({2, 'm'}) box.commit()
......@@ -37,6 +40,8 @@ replication = box.cfg.replication
box.cfg{replication = {}}
box.cfg{replication = replication}
-- replication stopped of third transaction
-- flush wal
box.space.l_space:replace({1})
v1[1] + 2 == box.info.vclock[1]
box.space.test:select()
-- check replication status
......
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