small regression script improvement - Mailing list pgsql-patches

From Andrew Dunstan
Subject small regression script improvement
Date
Msg-id 4495D1C9.1020009@dunslane.net
Whole thread Raw
Responses Re: small regression script improvement  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
This suggested patch makes sure that the regression script can actually
connect to the database rather than falling through after 60 seconds, as
discussed on -hackers.

cheers

andrew
Index: pg_regress.sh
===================================================================
RCS file: /cvsroot/pgsql/src/test/regress/pg_regress.sh,v
retrieving revision 1.64
diff -c -r1.64 pg_regress.sh
*** pg_regress.sh    5 Jan 2006 03:01:38 -0000    1.64
--- pg_regress.sh    18 Jun 2006 22:19:53 -0000
***************
*** 457,471 ****
          sleep 1
      done

!     if kill -0 $postmaster_pid >/dev/null 2>&1
      then
          echo "running on port $PGPORT with pid $postmaster_pid"
!     else
          echo
          echo "$me: postmaster did not start"
          echo "Examine $LOGDIR/postmaster.log for the reason."
          echo
          (exit 2); exit
      fi

  else # not temp-install
--- 457,482 ----
          sleep 1
      done

!     kill -0 $postmaster_pid >/dev/null 2>&1
!     running=$?
!     if test $running -eq 0 -a $i -lt $max
      then
          echo "running on port $PGPORT with pid $postmaster_pid"
!     elif test $running -neq 0
!     then
!         # postmaster is not running
          echo
          echo "$me: postmaster did not start"
          echo "Examine $LOGDIR/postmaster.log for the reason."
          echo
          (exit 2); exit
+     else
+         # postmaster is running but we can't connect
+         echo
+         echo "$me: postmaster started but did not accept connections after $max seconds"
+         echo
+         kill $postmaster_pid
+         (exit 2); exit
      fi

  else # not temp-install

pgsql-patches by date:

Previous
From: "Peter Brant"
Date:
Subject: Re: [BUGS] [Win32] Problem with rename()
Next
From: Tom Lane
Date:
Subject: Re: small regression script improvement