Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH] test: fix box/on_replace failure on consequent runs.
@ 2019-06-04  7:52 Serge Petrenko
  2019-06-04 14:17 ` Vladimir Davydov
  0 siblings, 1 reply; 2+ messages in thread
From: Serge Petrenko @ 2019-06-04  7:52 UTC (permalink / raw)
  To: vdavydov.dev; +Cc: tarantool-patches, Serge Petrenko

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-04 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-04  7:52 [PATCH] test: fix box/on_replace failure on consequent runs Serge Petrenko
2019-06-04 14:17 ` Vladimir Davydov

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