tests: capture tarantool log tail in startup errors - #587
Merged
Conversation
bigbes
force-pushed
the
bigbes/gh-147-fix-invalid-startup-panics
branch
from
May 5, 2026 09:07
6dba26a to
0b5c01f
Compare
bigbes
force-pushed
the
bigbes/gh-147-capture-tarantool-log-tail
branch
from
May 5, 2026 09:07
e5cea2a to
009c5df
Compare
oleg-jukovec
force-pushed
the
bigbes/gh-147-fix-invalid-startup-panics
branch
from
May 5, 2026 21:46
0b5c01f to
fe5c21d
Compare
Base automatically changed from
bigbes/gh-147-fix-invalid-startup-panics
to
master
May 5, 2026 22:00
bigbes
marked this pull request as ready for review
May 6, 2026 10:33
oleg-jukovec
requested changes
May 12, 2026
oleg-jukovec
left a comment
Collaborator
There was a problem hiding this comment.
Please, rebase the PR.
bigbes
force-pushed
the
bigbes/gh-147-capture-tarantool-log-tail
branch
from
May 12, 2026 22:38
009c5df to
3dcbbd6
Compare
Collaborator
Author
|
Rebased |
oleg-jukovec
force-pushed
the
bigbes/gh-147-capture-tarantool-log-tail
branch
from
May 15, 2026 11:29
3dcbbd6 to
aa75d81
Compare
oleg-jukovec
approved these changes
May 15, 2026
oleg-jukovec
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for the patch! I've remove extra dot after Closes #147 from the commit message.
When StartTarantool fails, the returned error gives only the connection
or exit reason ("exit status 1", "context deadline exceeded"), so a CI
failure required re-running the test locally to see why tarantool
actually refused to come up. Tarantool's own diagnostics — bad config,
port conflicts, missing modules, Lua errors during init — were written
to the child's stdout/stderr and silently dropped on the floor.
Wire a small ring buffer into Cmd.Stdout/Stderr that retains the last
50 lines, append it to the StartTarantool error on the two failure
paths (unexpected exit and connect failure), and expose the same tail
on TarantoolInstance for live tests.
Add test_helpers.DumpLogsIfFailed so a passing StartTarantool followed
by a later assertion failure can surface the captured log via t.Logf.
Intended idiom:
inst, err := test_helpers.StartTarantool(opts)
require.NoError(t, err)
defer test_helpers.StopTarantoolWithCleanup(inst)
defer test_helpers.DumpLogsIfFailed(t, inst)
Buffer is safe for concurrent writes from exec.Cmd's two copy goroutines
and preserves a partial trailing line if the process exits without
flushing a newline.
Closes #147
bigbes
force-pushed
the
bigbes/gh-147-capture-tarantool-log-tail
branch
from
May 15, 2026 11:44
aa75d81 to
fa8abb2
Compare
sssciel
approved these changes
May 15, 2026
Merged
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.
When
StartTarantoolfails, the returned error gives only the connection or exit reason (exit status 1,context deadline exceeded), so a CI failure required re-running the test locally to see why tarantool actually refused to come up. Tarantool's own diagnostics — bad config, port conflicts, missing modules, Lua errors during init — were written to the child's stdout/stderr and silently dropped on the floor.New
logTailBufferring of the last 50 lines, wired intoCmd.Stdout/Cmd.Stderr. Safe for concurrent writes from the two copy goroutines; preserves a partial trailing line if the process exits without flushing a newline.Append the captured tail to the
StartTarantoolerror on both failure paths (unexpected exit, connect failure).New
(*TarantoolInstance).LogTail()exposing the same buffer for live tests.New
test_helpers.DumpLogsIfFailed(t, inst)helper for the idiom:Closes #147.