diff options
author | Noah Misch <noah@leadboat.com> | 2018-12-31 13:50:32 -0800 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2018-12-31 13:51:26 -0800 |
commit | 2fe431f1be0fe6b54fb2d7c951737d8cc33bde6f (patch) | |
tree | df1a41d1d2c994958473f1052fa742c44ce11ce3 /src | |
parent | b7258a30aa6f1d4b53491174f372df07c5a6cd97 (diff) | |
download | postgresql-2fe431f1be0fe6b54fb2d7c951737d8cc33bde6f.tar.gz postgresql-2fe431f1be0fe6b54fb2d7c951737d8cc33bde6f.zip |
pg_regress: Promptly detect failed postmaster startup.
Detect it the way pg_ctl's wait_for_postmaster() does. When pg_regress
spawned a postmaster that failed startup, we were detecting that only
with "pg_regress: postmaster did not respond within 60 seconds".
Back-patch to 9.4 (all supported versions).
Reviewed by Tom Lane.
Discussion: https://postgr.es/m/20181231172922.GA199150@gust.leadboat.com
Diffstat (limited to 'src')
-rw-r--r-- | src/test/regress/pg_regress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 3de54beb2cc..40681afe6e3 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -2358,7 +2358,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc * Fail immediately if postmaster has exited */ #ifndef WIN32 - if (kill(postmaster_pid, 0) != 0) + if (waitpid(postmaster_pid, NULL, WNOHANG) == postmaster_pid) #else if (WaitForSingleObject(postmaster_pid, 0) == WAIT_OBJECT_0) #endif |