small regression script improvement

Started by Andrew Dunstanabout 20 years ago3 messagespatches
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

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

Attachments:

regress.patchtext/x-patch; name=regress.patchDownload+15-8
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#1)
Re: small regression script improvement

Andrew Dunstan <andrew@dunslane.net> writes:

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.

Oh, I see what you mean. But surely that's the hard way. The script
should just fail where it currently "break"s out of the loop. It's
not any longer and it permits a more specific error message.

regards, tom lane

*** src/test/regress/pg_regress.sh.orig	Wed Jan  4 22:01:38 2006
--- src/test/regress/new/pg_regress.sh	Sun Jun 18 18:42:24 2006
***************
*** 446,472 ****
          i=`expr $i + 1`
          if [ $i -ge $max ]
          then
!             break
          fi
          if kill -0 $postmaster_pid >/dev/null 2>&1
          then
              : still starting up
          else
!             break
          fi
          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

--- 446,473 ----
          i=`expr $i + 1`
          if [ $i -ge $max ]
          then
!             : timeout
!             echo
!             echo "$me: postmaster is not accepting connections"
!             echo "Examine $LOGDIR/postmaster.log for the reason."
!             echo
!             (exit 2); exit
          fi
          if kill -0 $postmaster_pid >/dev/null 2>&1
          then
              : still starting up
          else
!             : postmaster failed
!             echo
!             echo "$me: postmaster failed"
!             echo "Examine $LOGDIR/postmaster.log for the reason."
!             echo
!             (exit 2); exit
          fi
          sleep 1
      done

! echo "running on port $PGPORT with pid $postmaster_pid"

else # not temp-install

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: small regression script improvement

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

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.

Oh, I see what you mean. But surely that's the hard way. The script
should just fail where it currently "break"s out of the loop. It's
not any longer and it permits a more specific error message.

Good point. I'll do that.

cheers

andrew