server: fix grep_log not finding string logged immediately before#422
Merged
Conversation
With Tarantool 3.2 and newer the test fails with:
```
...luatest/test/luaunit/assertions_error_test.lua:244: Unexpected error trace,
expected: {file = "/home/runner/work/luatest/luatest/luatest/assertions.lua", line = 102},
actual: {
file = "...k/luatest/luatest/test/luaunit/assertions_error_test.lua",
line = 236,
}
```
On older Tarantool versions the error trace isn't checked because
`tarantool._internal.trace_check_is_required` isn't defined there.
Tarantool 3.2 is the first version that defines this internal function.
Since `error.raise` used by the test resides in 'builtin/error.lua',
stack trace checking is enabled for this function.
The problem is `error.raise()` does not change the original error trace
while `t.assert_error_covers()` expects the trace to point to the place
where `error.raise()` was invoked. Let's use `box.error()` instead so
the new error has the expected trace.
Also change `box.error.ILLEGAL_PARAMS` to `box.error.UNSUPPORTED` for
the check to pass because in Tarantool 3.2 the former was changed to
`{type = 'IllegalParams'}`.
Ubuntu 20.04 is no longer supported by GitHub runners. Note that Tarantool versions < 2.11 are too old and not available on ubuntu-latest so they're removed from the test matrix. Instead we add all Tarantool 3.x versions released so far.
Logs written by a test server go through a pipe and are processed by a luatest fiber before they make it to the log file so if grep_log() is called immediately after exec() that writes something to the log it may fail to find the logged string. Let's fix this issue by writing a unique marker string to the server log via exec() and retrying grep_log() until we find the marker. Closes tarantool#421
nshy
approved these changes
May 29, 2025
Contributor
nshy
left a comment
There was a problem hiding this comment.
Checked the test fix commit.
Totktonada
approved these changes
May 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Logs written by a test server go through a pipe and are processed by a luatest fiber before they make it to the log file so if
grep_log()is called immediately afterexec()that writes something to the log it may fail to find the logged string. Let's fix this issue by writing a unique marker string to the server log viaexec()and retryinggrep_log()until we find the marker.Closes #421