From 274b1b10e41dd2609c0aa9a4551a1660410cf7b3 Mon Sep 17 00:00:00 2001 From: Christopher Carroll Smith Date: Tue, 10 Dec 2024 10:38:24 -0500 Subject: [PATCH] Fixed test of timeout --- tests/testthat/test-ids_bulk.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-ids_bulk.R b/tests/testthat/test-ids_bulk.R index beb90be..aa82274 100644 --- a/tests/testthat/test-ids_bulk.R +++ b/tests/testthat/test-ids_bulk.R @@ -111,8 +111,14 @@ test_that("ids_bulk handles timeout parameter correctly", { local_mocked_bindings( check_interactive = function() FALSE, download_file = function(...) { - Sys.sleep(2) - stop("Operation timed out", call. = FALSE) + current_timeout <- getOption("timeout") + # Verify the timeout option was set correctly + if (current_timeout == 1) { + stop(paste0( + "Download timed out after ", current_timeout, " seconds" + ), call. = FALSE) + } + stop("Unexpected timeout value", call. = FALSE) }, get_response_headers = function(...) list("content-length" = "1000") )