From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Serge Petrenko Subject: [PATCH] test: fix box/on_replace failure on consequent runs. Date: Tue, 4 Jun 2019 10:52:00 +0300 Message-Id: <20190604075200.13498-1-sergepetrenko@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: vdavydov.dev@gmail.com Cc: tarantool-patches@freelists.org, Serge Petrenko List-ID: Example: ``` [001] box/on_replace.test.lua [ pass ] [001] box/on_replace.test.lua [ fail ] [001] [001] Test failed! Result content mismatch: [001] --- box/on_replace.result Tue Jun 4 10:44:39 2019 [001] +++ box/on_replace.reject Tue Jun 4 10:44:50 2019 [001] @@ -4,7 +4,7 @@ [001] -- test c and lua triggers: must return only lua triggers [001] #box.space._space:on_replace() [001] --- [001] -- 0 [001] +- 2 [001] ... ``` This happened because we forgot to remove triggers set on _space. Clear them below the test case. --- No issue. https://github.com/tarantool/tarantool/tree/sp/box-on-replace-flaky test/box/on_replace.result | 6 ++++++ test/box/on_replace.test.lua | 2 ++ 2 files changed, 8 insertions(+) diff --git a/test/box/on_replace.result b/test/box/on_replace.result index b2a4b2179..a2f514097 100644 --- a/test/box/on_replace.result +++ b/test/box/on_replace.result @@ -142,6 +142,12 @@ type(box.space._space:on_replace(f2)) --- - 2 ... +box.space._space:on_replace(nil, f) +--- +... +box.space._space:on_replace(nil, f2) +--- +... -- -- gh-587: crash on attempt to modify space from triggers -- diff --git a/test/box/on_replace.test.lua b/test/box/on_replace.test.lua index a6150b0ee..7fffc1e02 100644 --- a/test/box/on_replace.test.lua +++ b/test/box/on_replace.test.lua @@ -52,6 +52,8 @@ function f2() print('test2') end type(box.space._space:on_replace(f2)) #box.space._space:on_replace() +box.space._space:on_replace(nil, f) +box.space._space:on_replace(nil, f2) -- -- gh-587: crash on attempt to modify space from triggers -- 2.20.1 (Apple Git-117)