postgres.git / summary / log / commit / refs

commit    7c97b0f55e751297a5e30c0de28a779b945aa706
Author:   Noah Misch <noah@leadboat.com>
Date:     Mon Dec 31 21:50:32 2018 +0000
First released in: 12.0, 9.4.21, 9.5.16, 9.6.12, 10.7, 11.2

    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


src/test/regress/pg_regress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index acf26821d79..5d08d1e12e5 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -2390,7 +2390,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 [parent: af99ad191a3c]