-
Mauritz Sundell authored
BY MTR (NOT ~/.MY.CNF) Description: ============ MTR generates a my.cnf configuration file that contains content of the test specific configuration and all extra my.cnf files given on command line (./mtr --defaults-extra-file=xxx ...). For server programs that mtr starts from mysql-test-run.pl, command line arguments --defaults-file are used to refer to that file. MTR also set the MYSQL_HOME environment variable, which will cause any program that test starts without explicit --defaults-file or --no-defaults to find the mtr generated my.cnf - but in that case it will also look for other my.cnf files that may exists, system wide or user specific. The latter files can contain settings that changes test results in an unpredictable way. Some test cases use explicit --no-defaults and sometimes also --ndb-connectstring="$NDB_CONNECTSTRING" which indicates that someone sometime have had problems with programs using wrong configuration. Our automated test environments probably have no my.cnf or at least no my.cnf with configuration for programs typically started by tests since we do not seem to have any problems there. How To Repeat: ============== In for example ~/.my.cnf add: [mysql_cluster] bad-option And run for example: ./mtr ndb.apply_stored_grants [ 0%] ndb.apply_stored_grants [ fail ] Test ended at 2020-09-22 23:12:37 CURRENT_TEST: ndb.apply_stored_grants ndb_delete_all: [ERROR] unknown option '--bad-option'. mysqltest: At line 205: Command "$NDB_DELETE_ALL -d mysql ndb_sql_metadata" failed. Instead of bad-option one could add a valid option with some misleading value: [mysql_cluster] ndb-connectstring=localhost:1186 Result like: [ 50%] ndb.apply_stored_grants [ fail ] Test ended at 2020-09-22 23:22:26 CURRENT_TEST: ndb.apply_stored_grants mysqltest: At line 205: Command "$NDB_DELETE_ALL -d mysql ndb_sql_metadata" failed. Fix: ==== Programs are typically started from tests with --exec $NDB_XXX ... there NDB_XXX is the full path to command named ndb_xxx. Most NDB_XXX are defined in mysql-test-run.pl, some are done in specific test files that get sourced when needed. Now mysql-test-run.pl is changed to define all NDB_XXX including both program name and the correct --defaults-file=xxx option. That way most existing test will continue to work as today, and new tests will work properly. Suggestion is also that new NDB_XXX_EXE variables will be defined with only program names, and that may need to be used then program need to run with a special my.cnf or with --no-defaults. Also all test files that look up programs should be removed, and programs should only be found in mysql-test-run.pl. Also most uses of --no-defaults and --ndb-connectstring="$NDB_CONNECTSTRING" should be removed from test files. ndb_mgm should typically be called with --verbose=0 since that makes output more deterministic and recordable, that flag should be added in a [ndb_mgm] section in some default my.cnf. Also core-file=0 is a good default for [ndb_restore] section. Note: ===== Running ndb tests manually using mysqltest direct will not work without that caller has defined all environment variables for programs executed by test. Running ndb tests outside mtr have not been done in our automated testing for long and was already broken. Reviewed-by:
Magnus Blåudd <magnus.blaudd@oracle.com>
Mauritz Sundell authoredBY MTR (NOT ~/.MY.CNF) Description: ============ MTR generates a my.cnf configuration file that contains content of the test specific configuration and all extra my.cnf files given on command line (./mtr --defaults-extra-file=xxx ...). For server programs that mtr starts from mysql-test-run.pl, command line arguments --defaults-file are used to refer to that file. MTR also set the MYSQL_HOME environment variable, which will cause any program that test starts without explicit --defaults-file or --no-defaults to find the mtr generated my.cnf - but in that case it will also look for other my.cnf files that may exists, system wide or user specific. The latter files can contain settings that changes test results in an unpredictable way. Some test cases use explicit --no-defaults and sometimes also --ndb-connectstring="$NDB_CONNECTSTRING" which indicates that someone sometime have had problems with programs using wrong configuration. Our automated test environments probably have no my.cnf or at least no my.cnf with configuration for programs typically started by tests since we do not seem to have any problems there. How To Repeat: ============== In for example ~/.my.cnf add: [mysql_cluster] bad-option And run for example: ./mtr ndb.apply_stored_grants [ 0%] ndb.apply_stored_grants [ fail ] Test ended at 2020-09-22 23:12:37 CURRENT_TEST: ndb.apply_stored_grants ndb_delete_all: [ERROR] unknown option '--bad-option'. mysqltest: At line 205: Command "$NDB_DELETE_ALL -d mysql ndb_sql_metadata" failed. Instead of bad-option one could add a valid option with some misleading value: [mysql_cluster] ndb-connectstring=localhost:1186 Result like: [ 50%] ndb.apply_stored_grants [ fail ] Test ended at 2020-09-22 23:22:26 CURRENT_TEST: ndb.apply_stored_grants mysqltest: At line 205: Command "$NDB_DELETE_ALL -d mysql ndb_sql_metadata" failed. Fix: ==== Programs are typically started from tests with --exec $NDB_XXX ... there NDB_XXX is the full path to command named ndb_xxx. Most NDB_XXX are defined in mysql-test-run.pl, some are done in specific test files that get sourced when needed. Now mysql-test-run.pl is changed to define all NDB_XXX including both program name and the correct --defaults-file=xxx option. That way most existing test will continue to work as today, and new tests will work properly. Suggestion is also that new NDB_XXX_EXE variables will be defined with only program names, and that may need to be used then program need to run with a special my.cnf or with --no-defaults. Also all test files that look up programs should be removed, and programs should only be found in mysql-test-run.pl. Also most uses of --no-defaults and --ndb-connectstring="$NDB_CONNECTSTRING" should be removed from test files. ndb_mgm should typically be called with --verbose=0 since that makes output more deterministic and recordable, that flag should be added in a [ndb_mgm] section in some default my.cnf. Also core-file=0 is a good default for [ndb_restore] section. Note: ===== Running ndb tests manually using mysqltest direct will not work without that caller has defined all environment variables for programs executed by test. Running ndb tests outside mtr have not been done in our automated testing for long and was already broken. Reviewed-by:
Magnus Blåudd <magnus.blaudd@oracle.com>
Loading