From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Serge Petrenko Subject: [PATCH] test: fix engine/ddl occasional failure Date: Mon, 27 Aug 2018 11:26:05 +0300 Message-Id: <20180827082605.26670-1-sergepetrenko@tarantool.org> To: vdavydov.dev@gmail.com Cc: tarantool-patches@freelists.org, Serge Petrenko List-ID: 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)