Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH] test: fix engine/ddl occasional failure
@ 2018-08-27  8:26 Serge Petrenko
  2018-08-27  9:17 ` Vladimir Davydov
  0 siblings, 1 reply; 2+ messages in thread
From: Serge Petrenko @ 2018-08-27  8:26 UTC (permalink / raw)
  To: vdavydov.dev; +Cc: tarantool-patches, Serge Petrenko

Sometimes the test failed with output similar to the one below:

    [001] engine/ddl.test.lua	memtx           [ fail ]
    [001]
    [001] Test failed! Result content mismatch:
    [001] --- engine/ddl.result	Mon Aug 27 09:35:19 2018
    [001] +++ engine/ddl.reject	Mon Aug 27 11:12:47 2018
    [001] @@ -1932,7 +1932,7 @@
    [001]  ...
    [001]  s.index.pk:select()
    [001]  ---
    [001] -- - [1, 1, 11]
    [001] +- - [1, 1, 8]
    [001]  ...
    [001]  s.index.sk:select()
    [001]  ---

This happened due to a race condition in a test case added for
issue #3578.
To fix it we need to move c:get() above s.index.pk:select() to
make sure we actually wait for the fiber function to complete
before checking results.

Follow-up #3578.
---
https://github.com/tarantool/tarantool/issues/3578
https://github.com/tarantool/tarantool/tree/sp/engine-ddl-test-race
 test/engine/ddl.result   | 8 ++++----
 test/engine/ddl.test.lua | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/test/engine/ddl.result b/test/engine/ddl.result
index d1df0366f..ead00f9cb 100644
--- a/test/engine/ddl.result
+++ b/test/engine/ddl.result
@@ -1930,6 +1930,10 @@ _ = fiber.create(function() for i = 1, 10 do s:update(1, {{'+', 3, 1}}) end c:pu
 _ = s:create_index('sk', {parts = {2, 'unsigned'}})
 ---
 ...
+c:get()
+---
+- true
+...
 s.index.pk:select()
 ---
 - - [1, 1, 11]
@@ -1938,10 +1942,6 @@ s.index.sk:select()
 ---
 - - [1, 1, 11]
 ...
-c:get()
----
-- true
-...
 s:drop()
 ---
 ...
diff --git a/test/engine/ddl.test.lua b/test/engine/ddl.test.lua
index 89666b863..757e60b02 100644
--- a/test/engine/ddl.test.lua
+++ b/test/engine/ddl.test.lua
@@ -702,10 +702,11 @@ c = fiber.channel(1)
 _ = fiber.create(function() for i = 1, 10 do s:update(1, {{'+', 3, 1}}) end c:put(true) end)
 
 _ = s:create_index('sk', {parts = {2, 'unsigned'}})
+
+c:get()
 s.index.pk:select()
 s.index.sk:select()
 
-c:get()
 s:drop()
 
 --
-- 
2.15.2 (Apple Git-101.1)

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

* Re: [PATCH] test: fix engine/ddl occasional failure
  2018-08-27  8:26 [PATCH] test: fix engine/ddl occasional failure Serge Petrenko
@ 2018-08-27  9:17 ` Vladimir Davydov
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Davydov @ 2018-08-27  9:17 UTC (permalink / raw)
  To: Serge Petrenko; +Cc: tarantool-patches

Pushed to 1.10

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

end of thread, other threads:[~2018-08-27  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27  8:26 [PATCH] test: fix engine/ddl occasional failure Serge Petrenko
2018-08-27  9: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