Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate stack trace from Server:exec() #398

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

locker
Copy link
Member

@locker locker commented Oct 22, 2024

If a function executed with Server:exec() fails, luatest prints the stack trace only up to the Server:exec() call. If the failure happens to be in a nested function, this makes it impossible to figure out what happened.

Let's propagate the error stack trace from the server to the runner and make the runner concatenate it with its own stack trace. To achieve that, we wrap errors raised by the function executed by Serer:exec() to save the trace.

Closes #396

Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions for the first commit.

luatest/utils.lua Show resolved Hide resolved
luatest/utils.lua Outdated Show resolved Hide resolved
luatest/utils.lua Show resolved Hide resolved
luatest/utils.lua Outdated Show resolved Hide resolved
@locker locker force-pushed the server-exec-stack-traceback-fix branch from f4d3ba4 to d507318 Compare October 25, 2024 11:02
test/server_test.lua Outdated Show resolved Hide resolved
@Totktonada Totktonada assigned locker and unassigned Totktonada Oct 25, 2024
 * Strip uselss `...` and `eval` lines.
 * Scan the stack trace backwards so as to skip `[C]`, `...`, and `eval`
   lines that were called by luatest internal files, not vice versa.
 * Don't strip lines related to luatest test files (from luatest/test),
   even though they match the luatest internal file pattern, because
   we do want to see stack traces when we test luatest.

Needed for tarantool#396
@locker locker force-pushed the server-exec-stack-traceback-fix branch 2 times, most recently from c4d9c7a to ad991cc Compare October 25, 2024 13:25
@locker locker assigned Totktonada and unassigned locker Oct 25, 2024
CHANGELOG.md Outdated Show resolved Hide resolved
@Totktonada Totktonada assigned locker and unassigned Totktonada Oct 25, 2024
@locker locker force-pushed the server-exec-stack-traceback-fix branch from ad991cc to 701e551 Compare October 25, 2024 18:25
If a function executed with `Server:exec()` fails, luatest prints the
stack trace only up to the `Server:exec()` call. If the failure happens
to be in a nested function, this makes it impossible to figure out what
happened.

Let's propagate the error stack trace from the server to the runner
and make the runner concatenate it with its own stack trace. To achieve
that, we wrap errors raised by the function executed by `Serer:exec()`
to save the trace.

Closes tarantool#396
@locker locker force-pushed the server-exec-stack-traceback-fix branch from 701e551 to 292bf80 Compare October 25, 2024 18:40
@locker locker assigned Totktonada and unassigned locker Oct 25, 2024
@Totktonada Totktonada removed their assignment Oct 25, 2024
@locker locker merged commit 428a2f9 into tarantool:master Oct 25, 2024
9 checks passed
@locker locker deleted the server-exec-stack-traceback-fix branch October 25, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No stack trace on error/fail in server:exec()
2 participants