MDEV-40023 Error on unknown commands in check_expected_crash_and_restart#5229
MDEV-40023 Error on unknown commands in check_expected_crash_and_restart#5229FarihaIS wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request simplifies the restart command handling in the MariaDB test suite by removing the unused restart_bindir command and its associated environment variable handling. It also introduces strict error checking for unknown commands in the expect file. The review feedback highlights that the regular expression /^restart/ is too loose and will match any command starting with "restart" (e.g., "restarting"), suggesting it be tightened to /^restart\s*$/ to prevent silently ignoring invalid commands.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
d5c4ed9 to
4ba8b27
Compare
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution. This is a preliminary review.
LGTM. Please stand by for the final review.
There was a problem hiding this comment.
Pull request overview
Cleans up the .expect-file crash/restart control path in MTR by removing unused restart_bindir support and surfacing invalid expect-file commands as errors, to avoid silent misbehavior during crash/restart tests.
Changes:
- Remove the
restart_bindirhandling fromcheck_expected_crash_and_restart()and fromstart_mysqld.inc. - Treat unrecognized expect-file commands as fatal via
mtr_error()(instead of silently ignoring them). - Skip empty expect-file lines to mitigate partial-write races.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| mysql-test/mariadb-test-run.pl | Removes restart_bindir logic; adds stricter parsing/erroring for expect-file commands; skips empty lines. |
| mysql-test/include/start_mysqld.inc | Removes generation of restart_bindir commands in expect files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This was done for MDEV-25004 and was used to test upgrade between two build trees. I don't think removing such feature unused in main mtr workflow is a good idea. I've used it in the process of development and may use it later in such projects as MDEV-16417. It is useful for any development when you have to check how the binary data migrates the versions. |
|
@midenok thank you for your review, I had initially created this PR - and associated Jira MDEV-40023 - due to these two comments on my other PR (comment 1 and 2). Could you please let me know what the consensus is and whether these changes are still valid? Thank you! |
@FarihaIS Like I said in this PR I disagree with these changes. Is there some different questions by the provided links? Sorry, I just cannot understand. Please solve your task by improving the code, not by removing it. Is it the answer to your questions? |
3af3547 to
5c636b3
Compare
|
Thanks @midenok, that makes sense - I wasn't aware I've rescoped this PR to keep Please let me know if I have missed anything, thank you. Also, noting here that this change depends on #5221, i.e. |
Anchor the wait/restart regexes in mariadb-test-run.pl and call mtr_error() on anything else, so typos in expect files no longer fall through to a default restart. Chomp $last_line before matching and skip empty last lines to tolerate partial writes. restart_bindir is kept; it is used during development to test upgrades between two build trees. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
Description
check_expected_crash_and_restart()inmariadb-test-run.plsilently ignores anything in the expect file that does not start withrestart. This let typos likerestart_abortfall through to a default restart and made bugs like MDEV-39153 easy to miss.Fix:
wait/restart/restart_bindirregexes and callmtr_error()on any unrecognized commandchomp $last_linebefore matching so error messages don't embed a newline-z $expect_filecheck guards against)restart_bindiris left in place as it is used during development to test binary/data migration between two build trees.Release Notes
N/A
How can this PR be tested?
Execute the full MTR test suite — no test uses
restart_bindir, so removing it should have no effect. Themtr_error()change will prevent any future invalid expect file commands from failing silently.Basing the PR against the correct MariaDB version
Copyright
All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.