Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Ostanevich <sergos@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH 1/1] test: fix to resolve box/net_msg_max flaky
Date: Fri, 4 Dec 2020 21:21:40 +0300	[thread overview]
Message-ID: <BBE94868-7399-4274-8A6D-A40A609DC354@tarantool.org> (raw)


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)

             reply	other threads:[~2020-12-04 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 18:21 Sergey Ostanevich [this message]
2020-12-04 23:01 ` Vladislav Shpilevoy
2020-12-07  7:50   ` Sergey Ostanevich
2020-12-08 10:50   ` Alexander V. Tikhonov
2020-12-08 22:16 ` Vladislav Shpilevoy

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=BBE94868-7399-4274-8A6D-A40A609DC354@tarantool.org \
    --to=sergos@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] test: fix to resolve box/net_msg_max flaky' \
    /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