Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: vdavydov.dev@gmail.com
Cc: tarantool-patches@freelists.org,
	Serge Petrenko <sergepetrenko@tarantool.org>
Subject: [PATCH] test: fix box/on_replace failure on consequent runs.
Date: Tue,  4 Jun 2019 10:52:00 +0300	[thread overview]
Message-ID: <20190604075200.13498-1-sergepetrenko@tarantool.org> (raw)

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)

             reply	other threads:[~2019-06-04  7:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04  7:52 Serge Petrenko [this message]
2019-06-04 14:17 ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190604075200.13498-1-sergepetrenko@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH] test: fix box/on_replace failure on consequent runs.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox