From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id C6FF4315E1 for ; Fri, 21 Jun 2019 17:48:29 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qX_BXTvF6lSf for ; Fri, 21 Jun 2019 17:48:29 -0400 (EDT) Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 0E58831647 for ; Fri, 21 Jun 2019 17:48:29 -0400 (EDT) From: Georgy Kirichenko Subject: [tarantool-patches] [PATCH v5 7/7] test: fix flaky test Date: Sat, 22 Jun 2019 00:48:21 +0300 Message-Id: <81a4972f56a62ca54f1a99c0dd99295da2394f59.1561153472.git.georgy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Georgy Kirichenko This test fails sporadically --- test/replication/sync.result | 7 +++++-- test/replication/sync.test.lua | 4 ++-- test/replication/transaction.result | 16 +++++++++++++++- test/replication/transaction.test.lua | 7 ++++++- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/test/replication/sync.result b/test/replication/sync.result index eddc7cbc8..6b5a14d3f 100644 --- a/test/replication/sync.result +++ b/test/replication/sync.result @@ -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 diff --git a/test/replication/sync.test.lua b/test/replication/sync.test.lua index 52ce88fe2..f0f530ad4 100644 --- a/test/replication/sync.test.lua +++ b/test/replication/sync.test.lua @@ -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() diff --git a/test/replication/transaction.result b/test/replication/transaction.result index 8c2ac6ee4..c54c1e8d5 100644 --- a/test/replication/transaction.result +++ b/test/replication/transaction.result @@ -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 diff --git a/test/replication/transaction.test.lua b/test/replication/transaction.test.lua index f25a4737d..4e0323128 100644 --- a/test/replication/transaction.test.lua +++ b/test/replication/transaction.test.lua @@ -1,9 +1,12 @@ 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 -- 2.22.0