summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-04-10 13:06:02 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-04-10 13:06:02 +0200
commit8f13599a645a97df940640e9c70f164a92e8743c (patch)
tree1d939c19da36426f9ae86db5b8ee4745f4c66846
parentc7a86a38a3f657ab81163ac794450fc7ada2ba3c (diff)
downloadphp-git-8f13599a645a97df940640e9c70f164a92e8743c.tar.gz
Fix 29nb_async_connect.phpt
Intermediate states are unreliable across versions (I think), make sure we go through the whole connect procedure.
-rwxr-xr-xext/pgsql/tests/29nb_async_connect.phpt8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/pgsql/tests/29nb_async_connect.phpt b/ext/pgsql/tests/29nb_async_connect.phpt
index fc3868a26d..a9b17ebc3a 100755
--- a/ext/pgsql/tests/29nb_async_connect.phpt
+++ b/ext/pgsql/tests/29nb_async_connect.phpt
@@ -23,18 +23,20 @@ if (!$db = pg_connect($conn_str, PGSQL_CONNECT_ASYNC)) {
while (TRUE) {
switch ($status = pg_connect_poll($db)) {
case PGSQL_POLLING_READING:
- if (nb_is_readable($db_socket)) { break 2; }
+ nb_is_readable($db_socket);
break;
case PGSQL_POLLING_WRITING:
- if (nb_is_writable($db_socket)) { break 2; }
+ nb_is_writable($db_socket);
break;
case PGSQL_POLLING_FAILED:
die("async connection failed");
case PGSQL_POLLING_OK:
break 2;
+ default:
+ die("unknown poll status");
}
}
-assert(pg_connection_status($db) === PGSQL_CONNECTION_MADE);
+assert(pg_connection_status($db) === PGSQL_CONNECTION_OK);
echo "OK";
pg_close($db);