Skip to content
Snippets Groups Projects
Commit b88e31d4 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Merge #1238 test case to box/fiber.lua

parent ded3882b
No related merge requests found
LuajitError: inline.code:1: Lua error
ER_ILLEGAL_PARAMS: Illegal parameters, oh my
#!/usr/bin/env tarantool
-- #1238 log error if a fiber terminates due to uncaught Lua error
fiber = require('fiber')
box.cfg{logger="pipe:sed -e 's/^.*> //'", log_level=2}
-- must show in the log
fiber.create(loadstring("error('Lua error')","@inline.code"))
-- must NOT show in the log
fiber.create(function() fiber.self():cancel() end)
-- must show in the log
fiber.create(function() box.error(box.error.ILLEGAL_PARAMS, 'oh my') end)
os.exit()
......@@ -843,6 +843,33 @@ id == f:id()
---
- true
...
--
-- gh-1238: log error if a fiber terminates due to uncaught Lua error
--
-- must show in the log
_ = fiber.create(function() error('gh-1238') end)
---
...
test_run:grep_log("default", "gh%-1238") ~= nil
---
- true
...
-- must NOT show in the log
_ = fiber.create(function() fiber.self():cancel() end)
---
...
test_run:grep_log("default", "FiberIsCancelled") == nil
---
- true
...
-- must show in the log
_ = fiber.create(function() box.error(box.error.ILLEGAL_PARAMS, 'oh my') end)
---
...
test_run:grep_log("default", "ER_ILLEGAL_PARAMS:[^\n]*")
---
- 'ER_ILLEGAL_PARAMS: Illegal parameters, oh my'
...
fiber = nil
---
...
......@@ -329,4 +329,21 @@ id = f:id()
fiber.sleep(0)
f:status()
id == f:id()
--
-- gh-1238: log error if a fiber terminates due to uncaught Lua error
--
-- must show in the log
_ = fiber.create(function() error('gh-1238') end)
test_run:grep_log("default", "gh%-1238") ~= nil
-- must NOT show in the log
_ = fiber.create(function() fiber.self():cancel() end)
test_run:grep_log("default", "FiberIsCancelled") == nil
-- must show in the log
_ = fiber.create(function() box.error(box.error.ILLEGAL_PARAMS, 'oh my') end)
test_run:grep_log("default", "ER_ILLEGAL_PARAMS:[^\n]*")
fiber = nil
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