From 20d7f010a946fc310a39d48a2bb1a36bb5db2b4d Mon Sep 17 00:00:00 2001 From: Asim R P Date: Fri, 13 Nov 2020 14:02:24 +0530 Subject: [PATCH] Fix the script to check flaky test schedules The regex used in the script was too strict. Relax the regex so as to match 'select distinct gp_inject_fault(...);'. The script may be invoked against a directory, such as src/test/fsync, which may not contain any schedule files. This no longer results in an error. When invoked against isolation directory, it should scan tests under 'specs' subdir. Not all of input, sql and specs subdirs exist always, so add a '-s' option to grep to mask errors reporting non-existance. Co-authored-by: Hao Wu --- src/test/regress/greenplum_schedule | 3 ++- src/test/regress/scan_flaky_fault_injectors.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/regress/greenplum_schedule b/src/test/regress/greenplum_schedule index 4af3e5d60e..7bdb568c18 100755 --- a/src/test/regress/greenplum_schedule +++ b/src/test/regress/greenplum_schedule @@ -42,9 +42,10 @@ test: leastsquares opr_sanity_gp decode_expr bitmapscan bitmapscan_ao case_gp li test: gpcopy test: orca_static_pruning -test: filter gpctas gpdist gpdist_opclasses gpdist_legacy_opclasses matrix toast sublink table_functions olap_setup complex opclass_ddl information_schema guc_env_var gp_explain distributed_transactions explain_format olap_plans misc_jiras +test: filter gpctas gpdist gpdist_opclasses gpdist_legacy_opclasses matrix sublink table_functions olap_setup complex opclass_ddl information_schema guc_env_var gp_explain distributed_transactions explain_format olap_plans misc_jiras # below test(s) inject faults so each of them need to be in a separate group test: guc_gp +test: toast # namespace_gp test will show diff if concurrent tests use temporary tables. # So run it separately. diff --git a/src/test/regress/scan_flaky_fault_injectors.sh b/src/test/regress/scan_flaky_fault_injectors.sh index 94541270be..8fe9765544 100755 --- a/src/test/regress/scan_flaky_fault_injectors.sh +++ b/src/test/regress/scan_flaky_fault_injectors.sh @@ -12,14 +12,14 @@ parallel_tests=$(mktemp parallel_tests.XXX) retcode=0 # list the tests that inject faults -grep -ERIli '(select|perform)\s+gp_inject_fault' sql input \ +grep -sERIli '(select|perform)\s.*gp_inject_fault' sql input specs \ | sed 's,^[^/]*/\(.*\)\.[^.]*$,\1,' \ | sort -u \ > $fault_injection_tests echo "scanning for flaky fault-injection tests..." -for schedule in *_schedule; do +for schedule in $(ls *schedule 2>&1 | grep -v 'No such file'); do # list the tests that are in parallel testing groups grep -E '^test:(\s+\S+){2,}' $schedule \ | cut -d' ' -f2- \ -- GitLab