Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make parallel unit test more robust #623

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
env_cache(the, "test_app",
webfakes::new_app_process(
app,
opts = webfakes::server_opts(num_threads = 2)
opts = webfakes::server_opts(num_threads = 6, enable_keep_alive = TRUE)

Check warning on line 53 in R/test.R

View check run for this annotation

Codecov / codecov/patch

R/test.R#L53

Added line #L53 was not covered by tests
)
)
the$test_app$url()
Expand Down
8 changes: 2 additions & 6 deletions tests/testthat/test-multi-req.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ test_that("correctly prepares request", {
})

test_that("requests happen in parallel", {
# GHA MacOS builder seems to be very slow
skip_if(
isTRUE(as.logical(Sys.getenv("CI", "false"))) &&
Sys.info()[["sysname"]] == "Darwin"
)

# test works best if webfakes has ample threads and keepalive
reqs <- list2(
request_test("/delay/:secs", secs = 0),
request_test("/delay/:secs", secs = 0.25),
request_test("/delay/:secs", secs = 0.25),
request_test("/delay/:secs", secs = 0.25),
Expand Down
Loading