@@ -22,12 +22,10 @@ TEST_F(Storage, HTTPError) {
|
||||
|
||||
DefaultFileSource fs(nullptr);
|
||||
|
||||
auto &env = *static_cast<const Environment *>(nullptr);
|
||||
|
||||
auto start = uv_hrtime();
|
||||
|
||||
fs.request({ Resource::Unknown, "http://127.0.0.1:3000/temporary-error" }, uv_default_loop(),
|
||||
env, [&](const Response &res) {
|
||||
[&](const Response &res) {
|
||||
const auto duration = double(uv_hrtime() - start) / 1e9;
|
||||
EXPECT_LT(1, duration) << "Backoff timer didn't wait 1 second";
|
||||
EXPECT_GT(1.2, duration) << "Backoff timer fired too late";
|
||||
@@ -41,7 +39,7 @@ TEST_F(Storage, HTTPError) {
|
||||
HTTPTemporaryError.finish();
|
||||
});
|
||||
|
||||
fs.request({ Resource::Unknown, "http://127.0.0.1:3001/" }, uv_default_loop(), env,
|
||||
fs.request({ Resource::Unknown, "http://127.0.0.1:3001/" }, uv_default_loop(),
|
||||
[&](const Response &res) {
|
||||
const auto duration = double(uv_hrtime() - start) / 1e9;
|
||||
// 1.5 seconds == 4 retries, with a 500ms timeout (see above).
|
||||
|
||||
Reference in New Issue
Block a user