-
Notifications
You must be signed in to change notification settings - Fork 12
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
coredump: support options in pack
subcommand
#1059
Conversation
d7ea70a
to
f4a5c2f
Compare
f4a5c2f
to
339242d
Compare
6c9745a
to
0ade120
Compare
0ade120
to
1b1918f
Compare
1b1918f
to
0f013c1
Compare
0f013c1
to
c2be144
Compare
59707a5
to
2a3c652
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch!
2a3c652
to
2228bd5
Compare
80d06e6
to
c56a250
Compare
test/utils.py
Outdated
@@ -518,11 +518,12 @@ def is_valid_tarantool_installed( | |||
return True | |||
|
|||
|
|||
def get_tarantool_version(): | |||
def get_tarantool_version(env=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me suggest copying the logic from tt-ee
to look up tarantool
executable via the environment variable TARANTOOL_BIN
.
This would simplify parameter passing, it would be enough to set the right variable, without additional manipulations with PATH
and function arguments extension.
And, it will also bring the same logic to how the tarantool
search works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted to use executable path instead of changing environment. tt-ee
logic as-is is not suitable here.
@@ -54,7 +65,7 @@ def apport_crash_to_coredump(crash): | |||
resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, rlim_core_hard)) | |||
# Crash tarantool. | |||
cmd = ["tarantool", "-e", "require('ffi').cast('char *', 0)[0] = 42"] | |||
rc, output = run_command_and_get_output(cmd, cwd=coredump_tmpdir) | |||
rc, output = run_command_and_get_output(cmd, cwd=coredump_dir, env=env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, you will lose other environment settings that may be needed in some situations.
The right way would be to make a copy of the current environment and add new settings to it.
But, I suggest you make a copy of tarantool
search logic from the tt-ee
project, then you don't need to make such changes here, and nor add a new fixture
coredump_alt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted to use executable path instead of changing environment.
Considering that we need 2 different coredumps in the scope of single test session I see no way to avoid using another fixture.
return apport_unpack_dir / 'CoreDump' | ||
def coredump_systemd(core_source, outdir): | ||
core = outdir / core_source.stem | ||
rc, _ = run_command_and_get_output(['coredumpctl', 'dump', f'--output={core}']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't need output
why you keep the same function here?
rc, _ = run_command_and_get_output(['coredumpctl', 'dump', f'--output={core}']) | |
rc = subprocess.run(['coredumpctl', 'dump', f'--output={core}']).returncode |
This way the output of the command will not be captured and deleted, which will then appear in the log in case of problems with the test, and this in itself can help in finding problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reasonable. Fixed in both functions (the other function also doesn't use output).
c56a250
to
514aacd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch!
Please, add a TarantoolBot message into the commit. |
-e,--executable path Tarantool executable path -p,--pid pid PID of the dumped process -t,--time time Time of dump (seconds since the Epoch) Closes #763 @TarantoolBot document Title: support options in `tt coredump pack` subcommand
514aacd
to
98ab6a4
Compare
Done |
-e,--executable path
Tarantool executable path-p,--pid pid
PID of the dumped process-t,--time time
Time of dump (seconds since the Epoch)Closes #763