aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-11-17 00:24:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-11-17 00:24:03 +0000
commit4e5146b883f262d0074a3cbabb766508d087a0c5 (patch)
tree84accf40dfbbd50bd020af302386ba7c81486f8b /src
parent55d5b58538f1adbba7a7b1a1e7ad0b2a665f1f45 (diff)
downloadpostgresql-4e5146b883f262d0074a3cbabb766508d087a0c5.tar.gz
postgresql-4e5146b883f262d0074a3cbabb766508d087a0c5.zip
Suppress occasional failure of final DROP DATABASE due to
race condition --- old backend may not have shut down by the time we try to do the DROP.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/perl5/test.pl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/interfaces/perl5/test.pl b/src/interfaces/perl5/test.pl
index c9e0cf6c5e4..9d64336a698 100644
--- a/src/interfaces/perl5/test.pl
+++ b/src/interfaces/perl5/test.pl
@@ -1,6 +1,6 @@
#!/usr/local/bin/perl -w
-# $Id: test.pl,v 1.12 2000/03/11 02:57:24 tgl Exp $
+# $Id: test.pl,v 1.13 2000/11/17 00:24:03 tgl Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
@@ -260,6 +260,13 @@ if ($DEBUG) {
$conn = Pg::connectdb("dbname=$dbmain");
die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;
+# Race condition: it's quite possible that the DROP command will arrive
+# at the new backend before the old backend has finished shutting down,
+# resulting in an error message.
+# There doesn't seem to be any more graceful way around this than to
+# insert a small delay ...
+sleep(1);
+
$result = $conn->exec("DROP DATABASE $dbname");
die $conn->errorMessage unless PGRES_COMMAND_OK eq $result->resultStatus;