Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH] test: fix box/iproto_stress sporadic failure
@ 2019-02-28 14:24 Vladimir Davydov
  2019-02-28 15:31 ` Vladimir Davydov
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Davydov @ 2019-02-28 14:24 UTC (permalink / raw)
  To: tarantool-patches

This patch fixes the following test failure:

 | --- box/iproto_stress.result	Tue Dec 25 09:56:54 2018
 | +++ box/iproto_stress.reject	Tue Dec 25 10:12:22 2018
 | @@ -80,7 +80,7 @@
 |  ...
 |  n_workers -- 0
 |  ---
 | -- 0
 | +- 340
 |  ...
 |  n_errors -- 0
 |  ---
 | @@ -93,5 +93,3 @@
 |  ---
 |  ...
 |  box.cfg{net_msg_max = net_msg_max}
 | ----
 | -...

The problem is the test is quite cpu intensive so if the host is heavily
loaded (as it is often the case when tests are run on Travis CI), it may
take a few minutes to complete, while the timeout is set to 10 seconds.

To fix it, let's
 - Increase the timeout up to 60 seconds and use test_run.wait_cond
   instead of a homebrew loop.
 - Decrease the number of fibers from 400 down to 100 and adjust
   box.cfg.net_msg_max respectively.

Closes #3911
---
https://github.com/tarantool/tarantool/issues/3911
https://github.com/tarantool/tarantool/tree/dv/test-fixes

 test/box/iproto_stress.result   | 10 ++++------
 test/box/iproto_stress.test.lua |  7 +++----
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/test/box/iproto_stress.result b/test/box/iproto_stress.result
index 4239b49b..7149d6c5 100644
--- a/test/box/iproto_stress.result
+++ b/test/box/iproto_stress.result
@@ -10,7 +10,7 @@ net_box = require('net.box')
 net_msg_max = box.cfg.net_msg_max
 ---
 ...
-box.cfg{net_msg_max = 64}
+box.cfg{net_msg_max = 16}
 ---
 ...
 box.schema.user.grant('guest', 'read,write,execute', 'universe')
@@ -54,7 +54,7 @@ test_run:cmd("setopt delimiter ''");
 ---
 - true
 ...
-for i = 1,400 do fiber.create(worker, i) end
+for i = 1, 100 do fiber.create(worker, i) end
 ---
 ...
 fiber.sleep(0.1)
@@ -72,11 +72,9 @@ box.error.injection.set("ERRINJ_WAL_DELAY", false)
 ---
 - ok
 ...
-attempt = 0
----
-...
-while n_workers > 0 and attempt < 100 do fiber.sleep(0.1) attempt = attempt + 1 end
+test_run:wait_cond(function() return n_workers == 0 end, 60)
 ---
+- true
 ...
 n_workers -- 0
 ---
diff --git a/test/box/iproto_stress.test.lua b/test/box/iproto_stress.test.lua
index 2f307145..1e1a6578 100644
--- a/test/box/iproto_stress.test.lua
+++ b/test/box/iproto_stress.test.lua
@@ -4,7 +4,7 @@ fiber = require('fiber')
 net_box = require('net.box')
 
 net_msg_max = box.cfg.net_msg_max
-box.cfg{net_msg_max = 64}
+box.cfg{net_msg_max = 16}
 
 box.schema.user.grant('guest', 'read,write,execute', 'universe')
 
@@ -33,7 +33,7 @@ function worker(i)
 end;
 test_run:cmd("setopt delimiter ''");
 
-for i = 1,400 do fiber.create(worker, i) end
+for i = 1, 100 do fiber.create(worker, i) end
 fiber.sleep(0.1)
 
 -- check that iproto doesn't deplete tx fiber pool on wal stall (see gh-1892)
@@ -41,8 +41,7 @@ box.error.injection.set("ERRINJ_WAL_DELAY", true)
 fiber.sleep(0.1)
 box.error.injection.set("ERRINJ_WAL_DELAY", false)
 
-attempt = 0
-while n_workers > 0 and attempt < 100 do fiber.sleep(0.1) attempt = attempt + 1 end
+test_run:wait_cond(function() return n_workers == 0 end, 60)
 n_workers -- 0
 n_errors -- 0
 
-- 
2.11.0

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

* Re: [PATCH] test: fix box/iproto_stress sporadic failure
  2019-02-28 14:24 [PATCH] test: fix box/iproto_stress sporadic failure Vladimir Davydov
@ 2019-02-28 15:31 ` Vladimir Davydov
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Davydov @ 2019-02-28 15:31 UTC (permalink / raw)
  To: tarantool-patches

On Thu, Feb 28, 2019 at 05:24:06PM +0300, Vladimir Davydov wrote:
> This patch fixes the following test failure:
> 
>  | --- box/iproto_stress.result	Tue Dec 25 09:56:54 2018
>  | +++ box/iproto_stress.reject	Tue Dec 25 10:12:22 2018
>  | @@ -80,7 +80,7 @@
>  |  ...
>  |  n_workers -- 0
>  |  ---
>  | -- 0
>  | +- 340
>  |  ...
>  |  n_errors -- 0
>  |  ---
>  | @@ -93,5 +93,3 @@
>  |  ---
>  |  ...
>  |  box.cfg{net_msg_max = net_msg_max}
>  | ----
>  | -...
> 
> The problem is the test is quite cpu intensive so if the host is heavily
> loaded (as it is often the case when tests are run on Travis CI), it may
> take a few minutes to complete, while the timeout is set to 10 seconds.
> 
> To fix it, let's
>  - Increase the timeout up to 60 seconds and use test_run.wait_cond
>    instead of a homebrew loop.
>  - Decrease the number of fibers from 400 down to 100 and adjust
>    box.cfg.net_msg_max respectively.
> 
> Closes #3911
> ---
> https://github.com/tarantool/tarantool/issues/3911
> https://github.com/tarantool/tarantool/tree/dv/test-fixes
> 
>  test/box/iproto_stress.result   | 10 ++++------
>  test/box/iproto_stress.test.lua |  7 +++----
>  2 files changed, 7 insertions(+), 10 deletions(-)

Pushed to 2.1 and 1.10.

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

end of thread, other threads:[~2019-02-28 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 14:24 [PATCH] test: fix box/iproto_stress sporadic failure Vladimir Davydov
2019-02-28 15:31 ` Vladimir Davydov

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