Skip to content
Snippets Groups Projects
Commit 07a84a97 authored by Serge Petrenko's avatar Serge Petrenko Committed by Vladimir Davydov
Browse files

test: fix net.box occasional failure.

The test used to fail occasionally with a following error:

```
[001] box/net.box.test.lua                                            [ fail ]
[001]
[001] Test failed! Result content mismatch:
[001] —- box/net.box.result  Thu Jun 13 06:16:34 2019
[001] +++ box/net.box.reject  Fri Jun 14 04:50:55 2019
[001] @@ -3774,23 +3774,23 @@
[001]  ...
[001]  test_run:grep_log('default', 'Got a corrupted row.*')
[001]  —-
[001] — 'Got a corrupted row:'
[001] +- null
[001]  ...
[001]  test_run:grep_log('default', '00000000:.*')
[001]  —-
[001] — '00000000: A3 02 D6 5A E4 D9 E7 68 A1 53 8D 53 60 5F 20 3F '
[001] +- null
[001]  ...
[001]  test_run:grep_log('default', '00000010:.*')
[001]  —-
[001] — '00000010: D8 E2 D6 E2 A3 02 D6 5A E4 D9 E7 68 A1 53 8D 53 '
[001] +- null
[001]  ...
[001]  test_run:grep_log('default', '00000020:.*')
[001]  —-
[001] — '00000020: 60 5F 20 3F D8 E2 D6 E2 A3 02 D6 5A E4 D9 E7 68 '
[001] +- null
[001]  ...
[001]  test_run:grep_log('default', '00000030:.*')
[001]  —-
[001] — '00000030: A1 53 8D 53 60 5F 20 3F D8 E2 D6 E2 '
[001] +- null
[001]  ...
[001]  test_run:grep_log('default', '00000040:.*')
[001]  —-
```

This happened because we used `grep_log` right after `socket:write`,
which should cause the expected log messages. Change to `wait_log`.

Follow-up #4273
parent d3b2bcb6
No related branches found
No related tags found
No related merge requests found
......@@ -3772,26 +3772,27 @@ sock:close()
---
- true
...
test_run:grep_log('default', 'Got a corrupted row.*')
test_run:wait_log('default', 'Got a corrupted row.*', nil, 10)
---
- 'Got a corrupted row:'
...
test_run:grep_log('default', '00000000:.*')
test_run:wait_log('default', '00000000:.*', nil, 10)
---
- '00000000: A3 02 D6 5A E4 D9 E7 68 A1 53 8D 53 60 5F 20 3F '
...
test_run:grep_log('default', '00000010:.*')
test_run:wait_log('default', '00000010:.*', nil, 10)
---
- '00000010: D8 E2 D6 E2 A3 02 D6 5A E4 D9 E7 68 A1 53 8D 53 '
...
test_run:grep_log('default', '00000020:.*')
test_run:wait_log('default', '00000020:.*', nil, 10)
---
- '00000020: 60 5F 20 3F D8 E2 D6 E2 A3 02 D6 5A E4 D9 E7 68 '
...
test_run:grep_log('default', '00000030:.*')
test_run:wait_log('default', '00000030:.*', nil, 10)
---
- '00000030: A1 53 8D 53 60 5F 20 3F D8 E2 D6 E2 '
...
-- we expect nothing below, so don't wait
test_run:grep_log('default', '00000040:.*')
---
- null
......
......@@ -1531,11 +1531,12 @@ data = string.fromhex('3C'..string.rep(require('digest').sha1_hex('bcde'), 3))
sock:write(data)
sock:close()
test_run:grep_log('default', 'Got a corrupted row.*')
test_run:grep_log('default', '00000000:.*')
test_run:grep_log('default', '00000010:.*')
test_run:grep_log('default', '00000020:.*')
test_run:grep_log('default', '00000030:.*')
test_run:wait_log('default', 'Got a corrupted row.*', nil, 10)
test_run:wait_log('default', '00000000:.*', nil, 10)
test_run:wait_log('default', '00000010:.*', nil, 10)
test_run:wait_log('default', '00000020:.*', nil, 10)
test_run:wait_log('default', '00000030:.*', nil, 10)
-- we expect nothing below, so don't wait
test_run:grep_log('default', '00000040:.*')
box.cfg{log_level=log_level}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment