Skip to content

Commit

Permalink
Fix curl fd poll tests
Browse files Browse the repository at this point in the history
Apparently, this only works correctly with HTTP/1.1, and
fails with HTTP/2.
  • Loading branch information
gaborcsardi committed Jan 8, 2025
1 parent fb3b4d8 commit f084ec9
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/testthat/test-poll-curl.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

test_that("curl fds", {
skip_on_cran()
if (Sys.getenv("CI") != "" && Sys.info()[["sysname"]] == "Darwin") {
skip("fragile on GHA macOS")
}

resp <- list()
errm <- character()
Expand All @@ -13,15 +10,15 @@ test_that("curl fds", {
pool <- curl::new_pool()
url1 <- httpbin$url("/status/200")
url2 <- httpbin$url("/delay/1")
curl::multi_add(pool = pool, curl::new_handle(url = url1),
curl::multi_add(pool = pool, curl::new_handle(url = url1, http_version = 2),
done = done, fail = fail)
curl::multi_add(pool = pool, curl::new_handle(url = url1),
curl::multi_add(pool = pool, curl::new_handle(url = url1, http_version = 2),
done = done, fail = fail)
curl::multi_add(pool = pool, curl::new_handle(url = url2),
curl::multi_add(pool = pool, curl::new_handle(url = url2, http_version = 2),
done = done, fail = fail)
curl::multi_add(pool = pool, curl::new_handle(url = url1),
curl::multi_add(pool = pool, curl::new_handle(url = url1, http_version = 2),
done = done, fail = fail)
curl::multi_add(pool = pool, curl::new_handle(url = url1),
curl::multi_add(pool = pool, curl::new_handle(url = url1, http_version = 2),
done = done, fail = fail)

timeout <- Sys.time() + 5
Expand Down Expand Up @@ -56,7 +53,7 @@ test_that("curl fds before others", {

pool <- curl::new_pool()
url <- httpbin$url("/delay/1")
curl::multi_add(pool = pool, curl::new_handle(url = url))
curl::multi_add(pool = pool, curl::new_handle(url = url, http_version = 2))

timeout <- Sys.time() + 5
repeat {
Expand Down Expand Up @@ -87,7 +84,7 @@ test_that("process fd before curl fd", {

pool <- curl::new_pool()
url <- httpbin$url("/delay/1")
curl::multi_add(pool = pool, curl::new_handle(url = url))
curl::multi_add(pool = pool, curl::new_handle(url = url, http_version = 2))

timeout <- Sys.time() + 5
repeat {
Expand Down

0 comments on commit f084ec9

Please sign in to comment.