Skip to content

Commit

Permalink
test: fix another net.box failure
Browse files Browse the repository at this point in the history
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
#2763 (comment)
So, alter the test so that it tolerates multiple connection failures.

Closes #4273

(cherry picked from commit 1a2addb)
  • Loading branch information
sergepetrenko authored and kyukhin committed Jul 19, 2019
1 parent 64d4b75 commit 1d5e8dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions test/box/net.box.result
Expand Up @@ -2117,16 +2117,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')
---
Expand Down
5 changes: 3 additions & 2 deletions test/box/net.box.test.lua
Expand Up @@ -863,9 +863,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')

--
Expand Down

0 comments on commit 1d5e8dd

Please sign in to comment.