[PATCH] test: fix another net.box failure

Serge Petrenko sergepetrenko at tarantool.org
Fri Jul 19 09:52:07 MSK 2019


This last error
```
[035]  ...
[035]  disconnected_cnt
[035]  ---
[035] -- 1
[035] +- 2
[035]  ...
[035]  conn:close()
[035]  ---
[035]  ...
[035]  disconnected_cnt
[035]  ---
[035] -- 2
[035] +- 3
[035]  ...
[035]  test_run:cmd('stop server connecter')
[035]  ---
[035]
```
Happens because net.box is able to connect to tarantool before it has
finished bootstrap. When connecting, net.box tries to fetch schema
executing a couple of selects, but fails to pass access check since
grants aren't applied yet. This is described in detail in
https://github.com/tarantool/tarantool/issues/2763#issuecomment-499046998
So, alter the test so that it tolerates multiple connection failures.

Closes #4273
---
https://github.com/tarantool/tarantool/issues/4273
https://github.com/tarantool/tarantool/tree/sp/gh-4273-netbox

 test/box/net.box.result   | 11 +++++++----
 test/box/net.box.test.lua |  5 +++--
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/test/box/net.box.result b/test/box/net.box.result
index 08039562f..1d9f43400 100644
--- a/test/box/net.box.result
+++ b/test/box/net.box.result
@@ -2343,16 +2343,19 @@ connected_cnt
 ---
 - 1
 ...
-disconnected_cnt
+old_disconnected_cnt = disconnected_cnt
 ---
-- 1
+...
+disconnected_cnt >= 1
+---
+- true
 ...
 conn:close()
 ---
 ...
-disconnected_cnt
+disconnected_cnt == old_disconnected_cnt + 1
 ---
-- 2
+- true
 ...
 test_run:cmd('stop server connecter')
 ---
diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua
index 3677b3076..de629ab59 100644
--- a/test/box/net.box.test.lua
+++ b/test/box/net.box.test.lua
@@ -949,9 +949,10 @@ test_run:cmd('stop server connecter')
 test_run:cmd('start server connecter')
 while conn.state ~= 'active' do fiber.sleep(0.1) end
 connected_cnt
-disconnected_cnt
+old_disconnected_cnt = disconnected_cnt
+disconnected_cnt >= 1
 conn:close()
-disconnected_cnt
+disconnected_cnt == old_disconnected_cnt + 1
 test_run:cmd('stop server connecter')
 
 --
-- 
2.20.1 (Apple Git-117)




More information about the Tarantool-patches mailing list