summaryrefslogtreecommitdiff
path: root/test/it_url_slow.t
diff options
context:
space:
mode:
Diffstat (limited to 'test/it_url_slow.t')
-rwxr-xr-xtest/it_url_slow.t14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/it_url_slow.t b/test/it_url_slow.t
index 28b1bf9..59afe7e 100755
--- a/test/it_url_slow.t
+++ b/test/it_url_slow.t
@@ -9,7 +9,7 @@ require 'it_url_server.php';
handle_server(
is(
- it_url::get('http://localhost:8000/short_sleep'),
+ it_url::get("http://$host/short_sleep"),
"Testserver output after short sleep",
'it_url::get() receives full output after short sleep'
)
@@ -17,7 +17,7 @@ handle_server(
$start = microtime(true);
$res = is(
- it_url::get(['url' => 'http://localhost:8000/long_sleep', 'timeout' => 4, 'retries' => 0, 'it_error' => false]),
+ it_url::get(['url' => "http://$host/long_sleep", 'timeout' => 4, 'retries' => 0, 'it_error' => false]),
false,
'it_url::get() fails after timeout seconds with no output'
);
@@ -33,7 +33,7 @@ if (!$res || !$res2)
handle_server(
is(
- it_url::get('http://localhost:8000/slow_response'),
+ it_url::get("http://$host/slow_response"),
implode('', it::map('"Testserver slow output $v\n"', range(0, 5))),
'it_url::get() waits for slow response with continuous output'
)
@@ -41,7 +41,7 @@ handle_server(
$start = microtime(true);
$res = ok(
- !it_url::get(['url' => 'http://localhost:8000/slow_response', 'totaltimeout' => 5, 'retries' => 0, 'it_error' => false]),
+ !it_url::get(['url' => "http://$host/slow_response", 'totaltimeout' => 5, 'retries' => 0, 'it_error' => false]),
'it_url::get() fails for response slower than totaltimeout'
);
$res2 = is(
@@ -55,7 +55,7 @@ if (!$res || !$res2)
$start = microtime(true);
$res = ok(
- !it_url::get(['url' => 'http://localhost:8000/slow_response', 'maxlength' => 10, 'retries' => 0, 'it_error' => false]),
+ !it_url::get(['url' => "http://$host/slow_response", 'maxlength' => 10, 'retries' => 0, 'it_error' => false]),
'it_url::get() fails for response larger than maxlength'
);
$res2 = is(
@@ -69,12 +69,12 @@ if (!$res || !$res2)
handle_server(
ok(
- it_url::get(U('http://localhost:8000/repeat', ['string' => "abc", 'num' => 1024 * 1024])) == str_repeat("abc", 1024 * 1024),
+ it_url::get(U("http://$host/repeat", ['string' => "abc", 'num' => 1024 * 1024])) == str_repeat("abc", 1024 * 1024),
'it_url::get() handles large response'
)
);
$start = microtime(true);
-it_url::get_multi(['urls' => ['slow' => 'http://localhost:8000/long_sleep', 'fast' => ['url' => 'http://search.ch/', 'handler' => function () {return true;}]]]);
+it_url::get_multi(['urls' => ['slow' => "http://$host/long_sleep", 'fast' => ['url' => 'http://search.ch/', 'handler' => function () {return true;}]]]);
ok(intval(microtime(true) - $start) < 4, 'get_multi with handler aborts after fast request');
$output = server_output();