Skip to content

Commit 1c33f18

Browse files
committed
PHPC-128: ping should be fast
1 parent cdc6471 commit 1c33f18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/utils/orchestration.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ function __construct($baseuri) {
1515

1616
function ping() {
1717
try {
18+
$t = $this->setTimeout(1);
1819
$data = $this->get("");
20+
$this->setTimeout($t);
1921
} catch(\Exception $e) {
22+
$this->setTimeout($t);
2023
return false;
2124
}
2225
return true;
@@ -92,6 +95,11 @@ function stopId($id) {
9295
}
9396
}
9497

98+
function setTimeout($t) {
99+
$retval = $this->conf["timeout"];
100+
$this->conf["timeout"] = $t;
101+
return $retval;
102+
}
95103
function getTimeout() {
96104
return $this->conf["timeout"];
97105
}

0 commit comments

Comments
 (0)