From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 5FBCE6ECE3; Tue, 23 Nov 2021 01:43:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5FBCE6ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1637620985; bh=q5Md37f1vb6cpURPEYerx+ba4KlNh+FNuK+tHSpb90Y=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XgfGYsVRdDw0AKfrdaBknHhevt+qVvXHfL5RJMQ7BSwE7bDZErDk01x+1ubCONxBz niU/RaPhya4zmyiGM3hREzBwaXjtFQSZ/r1pjV04sjIRdJdoju72OearHI8eSQMmvd e7rNL+1pw8MhaatSFuNpYIoxEQJAvD+BpPXnom2w= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 80BF66ECE3 for ; Tue, 23 Nov 2021 01:43:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 80BF66ECE3 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1mpI1e-0004IW-3f; Tue, 23 Nov 2021 01:43:02 +0300 To: tarantool-patches@dev.tarantool.org, olegrok@tarantool.org Date: Mon, 22 Nov 2021 23:43:00 +0100 Message-Id: <8bdbe3aacf7cb712ef25a334043e82bf2e7da7dd.1637620945.git.v.shpilevoy@tarantool.org> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9FE0487E50246814603070A3D7AC5D99F678AF60FBC9B2968182A05F538085040CF13D3A217ACD85B2383353C124474165C27E94148E573BAB80AA4DDD8BB1D31 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70EEC24FFE855BCBBC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE71BF69A9C8C5AF260EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F215F47CC10020600438FC15A1819704A1CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BDC0F6C5B2EEF3D0C75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505D575B0F6464372C66A8D65CFCB598C79 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C4C7A0BC55FA0FE5FC82BA5CD1715B20FF22885FD66452412123A1EF0CA9A3F0DCB1881A6453793CE9C32612AADDFBE0610E421D18E1AB64ED9510FB958DCE06DB6ED91DBE5ABE359A7EE5648E065588D4B129A6C9085D3B6193EDB24507CE13387DFF0A840B692CF8 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D346F8291983715AC667EA203ACF5D942FB44ABE6418311371481B1CDD6F38907AD6042F1471C0499561D7E09C32AA3244CCAA81B8859EA5B0AD7731C39A05731F91DD47778AE04E04D729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojutWt0++zX5Sut2AITcWaeA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D9336548C5BEF0D5FAD7E17977AABB3C23841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH vshard 1/1] test: fix tests on the latest Tarantool X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" In the commit tarantool/39a462e09572df238b9a651447289e7fab87b9fd ("error: report ER_READONLY reason in message") the error message for the `box.error.READONLY` error was changed but vshard tests were not updated. This patch fixes them so they don't depend on this particular error message anymore. --- Branch: http://github.com/tarantool/vshard/tree/gerold103/fix-read_only-error test/storage/demote_sync_errinj.result | 7 +++++-- test/storage/demote_sync_errinj.test.lua | 3 ++- test/storage/read_only_slave.result | 12 +++++++----- test/storage/read_only_slave.test.lua | 5 +++-- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/test/storage/demote_sync_errinj.result b/test/storage/demote_sync_errinj.result index d40878c..cc104d9 100644 --- a/test/storage/demote_sync_errinj.result +++ b/test/storage/demote_sync_errinj.result @@ -52,9 +52,12 @@ f:status() - suspended ... -- Can not write - read only mode is already on. -s:replace{1} +ok, err = pcall(s.replace, s, {1}) --- -- error: Can't modify data because this instance is in read-only mode. +... +assert(not ok and err.code == box.error.READONLY) +--- +- true ... test_run:switch('storage_1_b') --- diff --git a/test/storage/demote_sync_errinj.test.lua b/test/storage/demote_sync_errinj.test.lua index 15b951d..7109ac5 100644 --- a/test/storage/demote_sync_errinj.test.lua +++ b/test/storage/demote_sync_errinj.test.lua @@ -17,7 +17,8 @@ cfg.sharding[util.replicasets[1]].replicas[util.name_to_uuid.storage_1_a].master f = fiber.create(function() vshard.storage.cfg(cfg, util.name_to_uuid.storage_1_a) end) f:status() -- Can not write - read only mode is already on. -s:replace{1} +ok, err = pcall(s.replace, s, {1}) +assert(not ok and err.code == box.error.READONLY) test_run:switch('storage_1_b') cfg.sharding[util.replicasets[1]].replicas[util.name_to_uuid.storage_1_b].master = true diff --git a/test/storage/read_only_slave.result b/test/storage/read_only_slave.result index a42807b..c863836 100644 --- a/test/storage/read_only_slave.result +++ b/test/storage/read_only_slave.result @@ -68,9 +68,12 @@ box.cfg.read_only --- - true ... -box.schema.create_space('test3') +ok, err = pcall(box.schema.create_space, 'test3') --- -- error: Can't modify data because this instance is in read-only mode. +... +assert(not ok and err.code == box.error.READONLY) +--- +- true ... fiber = require('fiber') --- @@ -129,10 +132,9 @@ box.cfg.read_only --- - true ... -ok, err +assert(not ok and err.code == box.error.READONLY) --- -- false -- Can't modify data because this instance is in read-only mode. +- true ... fiber = require('fiber') --- diff --git a/test/storage/read_only_slave.test.lua b/test/storage/read_only_slave.test.lua index c7f08ed..98efe03 100644 --- a/test/storage/read_only_slave.test.lua +++ b/test/storage/read_only_slave.test.lua @@ -23,7 +23,8 @@ box.space.test:select{} _ = test_run:switch('storage_1_b') box.cfg.read_only -box.schema.create_space('test3') +ok, err = pcall(box.schema.create_space, 'test3') +assert(not ok and err.code == box.error.READONLY) fiber = require('fiber') function on_master_enable() box.space.test:replace{3, 3} end function on_master_disable() if not box.cfg.read_only then box.space.test:replace{4, 4} end end @@ -46,7 +47,7 @@ cfg.sharding[util.replicasets[1]].replicas[util.name_to_uuid.storage_1_b].master cfg.sharding[util.replicasets[1]].replicas[util.name_to_uuid.storage_1_a].master = false vshard.storage.cfg(cfg, util.name_to_uuid.storage_1_a) box.cfg.read_only -ok, err +assert(not ok and err.code == box.error.READONLY) fiber = require('fiber') while box.space.test:count() ~= 2 do fiber.sleep(0.1) end box.space.test:select{} -- 2.24.3 (Apple Git-128)