From 38952eb812859224ed3f265089e33416272c85de Mon Sep 17 00:00:00 2001 From: Zhang Mingli Date: Thu, 5 Dec 2024 16:21:22 +0800 Subject: [PATCH] Fix confused print of gp_connections test case. When regression succeeds to run gp_connections case, some printed info are confused: ============== running regression test queries ============== test gp_connections ... ok (test process exited with exit code 2) While the test passed, but the message seems to tell us that the process exit unexpectedly. The case is designed to exit with code 2 which is expected: failed to connect a primary db. However the message may make developers confused and try to find something wrong but actually not. And after a failed connect, the script will exit, there is no chance to do something to make amends. Hacked in pg_regress to ignore gp_connections exit code info. ============== running regression test queries ============== test gp_connections ... ok 2500 ms This fix doesn't have an impact on test case behavior: if there is diffs between sql and expected files, the case failed as expected. Authored-by: Zhang Mingli avamingli@gmail.com --- src/test/regress/pg_regress.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 31a1b157899..f22f8a2cb82 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -2409,8 +2409,7 @@ run_schedule(const char *schedule, test_start_function startfunc, status(_("ok ")); /* align with FAILED */ success_count++; } - - if (statuses[i] != 0) + if (statuses[i] != 0 && (strcmp(test, "gp_connections") != 0)) log_child_failure(statuses[i]); INSTR_TIME_SUBTRACT(stoptimes[i], starttimes[i]); @@ -2502,7 +2501,7 @@ run_single_test(const char *test, test_start_function startfunc, success_count++; } - if (exit_status != 0) + if (exit_status != 0 && (strcmp(test, "gp_connections") != 0)) log_child_failure(exit_status); INSTR_TIME_SUBTRACT(stoptime, starttime);