Skip to content

Commit 3267e29

Browse files
committed
Fix a couple of portability problems in Jan's first-cut parallel test
script. This is way cool...
1 parent 43499af commit 3267e29

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

src/test/regress/run_check.sh

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.1 1999/11/19 18:51:49 wieck Exp $
3+
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.2 1999/11/20 20:21:30 tgl Exp $
44

55
# ----------
66
# This is currently needed because the actual 7.0 psql makes
@@ -96,7 +96,7 @@ SYSTEM=`/bin/sh ../../config.guess | awk -F\- '{ split($3,a,/[0-9]/); printf"%s-
9696
trap ' echo ""
9797
echo ""
9898
echo "user abort ..."
99-
if [ ! -z $PMPID ]
99+
if [ ! -z "$PMPID" ]
100100
then
101101
echo "Signalling postmaster with PID $PMPID to shutdown immediately"
102102
kill -2 $PMPID
@@ -110,7 +110,7 @@ trap ' echo ""
110110
# ----------
111111
# Prepare a clean check directory
112112
# ----------
113-
if [ -e $CHKDIR ]
113+
if [ -d $CHKDIR ]
114114
then
115115
echo "=============== Removing old ./tmp_check directory ... ================"
116116
rm -rf $CHKDIR
@@ -126,17 +126,14 @@ mkdir -p $LOGDIR
126126
# Install this build into ./tmp/check
127127
# ----------
128128
echo "=============== Installing new build into ./tmp_check ================"
129-
(
130-
cd ../..
131-
make POSTGRESDIR=$CHKDIR install >$LOGDIR/install.log 2>&1
132-
exit $?
133-
)
129+
${MAKE:-gmake} -C ../.. POSTGRESDIR=$CHKDIR install >$LOGDIR/install.log 2>&1
130+
134131
if [ $? -ne 0 ]
135132
then
136133
echo ""
137134
echo "ERROR: Check installation failed - cannot continue"
138135
echo "Please examine $LOGDIR/install.log"
139-
echo "for the errors occured."
136+
echo "for the reason."
140137
echo ""
141138
exit 2
142139
fi
@@ -168,9 +165,9 @@ initdb --pglib=$LIBDIR --pgdata=$PGDATA >$LOGDIR/initdb.log 2>&1
168165
if [ $? -ne 0 ]
169166
then
170167
echo ""
171-
echo "ERROR: Check installation failed - cannot continue"
168+
echo "ERROR: Check initdb failed - cannot continue"
172169
echo "Please examine $LOGDIR/initdb.log"
173-
echo "for the errors occured."
170+
echo "for the reason."
174171
echo ""
175172
exit 3
176173
fi
@@ -185,16 +182,17 @@ postmaster -D $PGDATA -p $PGPORT -o -F >$LOGDIR/postmaster.log 2>&1 &
185182
PMPID=$!
186183
sleep 2
187184

188-
if ! kill -0 $PMPID >/dev/null 2>&1
185+
if kill -0 $PMPID >/dev/null 2>&1
189186
then
187+
echo "Regression postmaster is running - PID=$PMPID PGPORT=$PGPORT"
188+
else
190189
echo ""
191190
echo "ERROR: Regression postmaster did not startup."
192-
echo "Please examing $LOGDIR/postmaster.log"
193-
echo "for the errors occured."
191+
echo "Please examine $LOGDIR/postmaster.log"
192+
echo "for the reason."
194193
echo ""
195194
exit 4
196195
fi
197-
echo "Regression postmaster is running - PID=$PMPID PGPORT=$PGPORT"
198196

199197

200198
# ----------
@@ -332,23 +330,21 @@ lno=0
332330
fi
333331

334332
# ----------
335-
# Tell what we're doing and start them all inside a
336-
# subshell in background. The bourne shell's wait is
333+
# Tell what we're doing and start them all in background.
334+
# The bourne shell's wait is
337335
# too dumb to do it smarter. I'd really like to see
338336
# the ok|failed message as soon as the individual tests
339337
# finish. That'd make it easier to start longer running
340338
# ones first to increase concurrency.
341339
# ----------
342-
gnam=`echo "$pargroup ($parntests tests)" | awk '{printf "%-26.26s", $line;}'`
340+
gnam=`echo "$pargroup ($parntests tests)" | awk '{printf "%-26.26s", $0;}'`
343341
$ECHO_N "parallel $gnam ... " $ECHO_C
344342

345-
(
346-
for name in $parlist ; do
347-
$FRONTEND regression < sql/${name}.sql \
348-
> results/${name}.out 2>&1
349-
done
350-
wait
351-
)
343+
for name in $parlist ; do
344+
$FRONTEND regression < sql/${name}.sql \
345+
> results/${name}.out 2>&1 &
346+
done
347+
wait
352348

353349
# ----------
354350
# Setup status information for the diff check below

src/test/regress/sql/run_check.tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ parallel group2
4040
endparallel
4141

4242
test abstime # Depends on the reltime test
43-
test horology # Depends on timespan, datetime, reltime and abstime
4443
test geometry # Depends on point, lseg, box, path, polygon and circle
44+
test horology # Depends on timespan, datetime, reltime and abstime
4545

4646
# ----------
4747
# These four each depend on the previous one

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy