[Tarantool-patches] [PATCH 1/1] test: fix to resolve box/net_msg_max flaky

Sergey Ostanevich sergos at tarantool.org
Fri Dec 4 21:21:40 MSK 2020


A problem was gh-4834-netbox-fiber-cancel left a request hanging
so the net_msg_max fails in case it follows on the same runner.
---
Branch: http://github.com/tarantool/tarantool/tree/sergos/gh-5013-followup

 test/box/gh-4834-netbox-fiber-cancel.result   | 7 ++++++-
 test/box/gh-4834-netbox-fiber-cancel.test.lua | 5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/test/box/gh-4834-netbox-fiber-cancel.result b/test/box/gh-4834-netbox-fiber-cancel.result
index 5af404e82..81adc4803 100644
--- a/test/box/gh-4834-netbox-fiber-cancel.result
+++ b/test/box/gh-4834-netbox-fiber-cancel.result
@@ -9,8 +9,12 @@ test_run = require('test_run').new()
  | ---
  | ...
 
+infinity = true
+ | ---
+ | ...
+
 -- #4834: Cancelling fiber doesn't interrupt netbox operations
-function infinite_call() local channel = fiber.channel(1) pcall(channel:get()) channel.close() end
+function infinite_call() while infinity do fiber.sleep(0.01) end end
  | ---
  | ...
 box.schema.func.create('infinite_call')
@@ -36,6 +40,7 @@ function netbox_runner()
     fiber.yield()
     f:cancel()
     f:join()
+    infinity = false
     cn:close()
 end;
  | ---
diff --git a/test/box/gh-4834-netbox-fiber-cancel.test.lua b/test/box/gh-4834-netbox-fiber-cancel.test.lua
index 59963ba91..2c7cba2dd 100644
--- a/test/box/gh-4834-netbox-fiber-cancel.test.lua
+++ b/test/box/gh-4834-netbox-fiber-cancel.test.lua
@@ -2,8 +2,10 @@ remote = require('net.box')
 fiber = require('fiber')
 test_run = require('test_run').new()
 
+infinity = true
+
 -- #4834: Cancelling fiber doesn't interrupt netbox operations
-function infinite_call() local channel = fiber.channel(1) pcall(channel:get()) channel.close() end
+function infinite_call() while infinity do fiber.sleep(0.01) end end
 box.schema.func.create('infinite_call')
 box.schema.user.grant('guest', 'execute', 'function', 'infinite_call')
 
@@ -18,6 +20,7 @@ function netbox_runner()
     fiber.yield()
     f:cancel()
     f:join()
+    infinity = false
     cn:close()
 end;
 test_run:cmd("setopt delimiter ''");
-- 
2.24.3 (Apple Git-128)




More information about the Tarantool-patches mailing list