unittests: Do not hang when error message is too long

This commit is contained in:
ZyX
2017-04-01 11:07:08 +03:00
parent 8de53157b6
commit 933d60bc23
3 changed files with 18 additions and 2 deletions

View File

@@ -554,8 +554,6 @@ local function gen_itp(it)
end
else
sc.close(wr)
sc.wait(child_pid)
child_pid = nil
local function check()
local res = sc.read(rd, 2)
eq(2, #res)
@@ -570,6 +568,8 @@ local function gen_itp(it)
assert.just_fail(err)
end
local err, emsg = pcall(check)
sc.wait(child_pid)
child_pid = nil
sc.close(rd)
if not err then
if allow_failure then