Skip to content

Commit 0dfd36c

Browse files
committed
Avoid retries in HTTP failure tests
1 parent 2de169f commit 0dfd36c

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/testthat/test-4-async-http.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ test_that("download_file", {
5858
test_that("download_file, errors", {
5959
tmp <- tempfile()
6060
err <- tryCatch(
61-
synchronise(download_file("http://0.42.42.42", tmp)),
61+
synchronise(download_file(
62+
"http://0.42.42.42",
63+
tmp,
64+
retry = FALSE,
65+
options = list(connecttimeout = 1)
66+
)),
6267
error = function(e) e
6368
)
6469
expect_s3_class(err, "async_rejected")
@@ -73,7 +78,7 @@ test_that("download_file, errors", {
7378
expect_s3_class(err2, "async_http_error")
7479

7580
ret <- synchronise(download_file(
76-
http$url("/statud/404"),
81+
http$url("/status/404"),
7782
tmp,
7883
error_on_status = FALSE
7984
))
@@ -139,7 +144,9 @@ test_that("download_if_newer, error", {
139144
err <- tryCatch(
140145
synchronise(download_if_newer(
141146
url <- "http://0.42.42.42",
142-
destfile = target
147+
destfile = target,
148+
retry = FALSE,
149+
options = list(connecttimeout = 1)
143150
)),
144151
error = function(e) e
145152
)

0 commit comments

Comments
 (0)