summaryrefslogtreecommitdiffstats
path: root/Tests/Auth/OpenID/StoreTest.php
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-02-08 20:33:36 +0000
committertailor <cygnus@janrain.com>2006-02-08 20:33:36 +0000
commit6fc2f50bb51bf793c35e00c914e686a9fdbd52b4 (patch)
tree2dda719062dc109e2e11ed7b111ad651a08d07af /Tests/Auth/OpenID/StoreTest.php
parent6a619a4cc8db4153635720ee2c1acdb303dae5ee (diff)
downloadphp-openid-6fc2f50bb51bf793c35e00c914e686a9fdbd52b4.zip
php-openid-6fc2f50bb51bf793c35e00c914e686a9fdbd52b4.tar.gz
php-openid-6fc2f50bb51bf793c35e00c914e686a9fdbd52b4.tar.bz2
[project @ Fixed database connection code for postgres store test.]
Diffstat (limited to 'Tests/Auth/OpenID/StoreTest.php')
-rw-r--r--Tests/Auth/OpenID/StoreTest.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/Tests/Auth/OpenID/StoreTest.php b/Tests/Auth/OpenID/StoreTest.php
index 75f2254..48cf33e 100644
--- a/Tests/Auth/OpenID/StoreTest.php
+++ b/Tests/Auth/OpenID/StoreTest.php
@@ -359,11 +359,24 @@ explicitly');
return;
}
- // Try to create the test database.
- $result = $template_db->query(sprintf("CREATE DATABASE %s",
- $temp_db_name));
+ $allowed_failures = 5;
+ $failures = 0;
+ $success = false;
+
+ while (($failures < $allowed_failures) && !$success) {
+ // Try to create the test database.
+ $result = $template_db->query(sprintf("CREATE DATABASE %s",
+ $temp_db_name));
+
+ if (PEAR::isError($result)) {
+ $failures++;
+ sleep(1);
+ } else {
+ $success = true;
+ }
+ }
- if (PEAR::isError($result)) {
+ if (!$success) {
$this->fail("Temporary database creation failed ".
"('$temp_db_name'): " . $result->getMessage());
return;