summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2018-12-31 13:50:32 -0800
committerNoah Misch <noah@leadboat.com>2018-12-31 13:51:15 -0800
commitca01a6748d0bfb594128833fec6a64e6d092d37f (patch)
treea0eb5d09d30b47714cb7cb2a38eb1f7a2638b826
parent025cc86b77052ee130519ce2dcfa52abeedc5bef (diff)
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
-rw-r--r--src/test/regress/pg_regress.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 3248603da19..9c6d2efb562 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2419,7 +2419,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