diff options
author | Urban Müller | 2020-08-04 17:55:30 +0200 |
---|---|---|
committer | Urban Müller | 2020-08-04 17:55:30 +0200 |
commit | 3538e258590fda78b697ef0e8280585f818034e4 (patch) | |
tree | 1c331b59eef8f77a5b7945321116570c082810df /test/it_url.t | |
parent | 8e92b60178c34f785d6bcdd4634345e8937605b1 (diff) | |
download | itools-3538e258590fda78b697ef0e8280585f818034e4.tar.gz itools-3538e258590fda78b697ef0e8280585f818034e4.tar.bz2 itools-3538e258590fda78b697ef0e8280585f818034e4.zip |
correctly retry in ::get_multi, do retry in status 5xx in ::get
Diffstat (limited to 'test/it_url.t')
-rwxr-xr-x | test/it_url.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/it_url.t b/test/it_url.t index 5bac758..1636bd6 100755 --- a/test/it_url.t +++ b/test/it_url.t @@ -316,6 +316,27 @@ ok(strpos($pages['a'], '</html>'), 'it_url::get_multi got first url'); # UTF8SAF ok(strpos($pages['b'], '</html>'), 'it_url::get_multi got second url'); # UTF8SAFE is(count($pages), 2, 'it_url::get_multi no additional array elements'); +handle_server( + is( + it_url::get('http://localhost:8000/maybe_error?chance=0'), + "success" + ), + is( + it_url::get('http://localhost:8000/maybe_error?chance=100'), + "failure" + ), + is( + it_url::get('url' => 'http://localhost:8000/maybe_error?chance=10', 'retries' => 10), + "success", + "Retry on sporadically failing url in ::get" + ), + is( + it_url::get_multi('urls' => ['http://localhost:8000/maybe_error?chance=10'], 'retries' => 10), + ["success"], + "Retry on sporadically failing url in ::get_multi" + ), +); + is(it_url::parse("/foo"), ["/foo"], "it_url::parse path only"); is(it_url::parse("/foo?"), ["/foo"], "it_url::parse empty parameter"); is(it_url::parse("/foo?bar=baz&qux=quux"), ["/foo", 'bar' => "baz", 'qux' => "quux"], "it_url::parse parameters"); |