Skip to content

Commit

Permalink
see if waiting a little more is more reliable on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jul 4, 2024
1 parent 01cfa54 commit 50d6d3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions r/adbcdrivermanager/tests/testthat/test-async.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,16 @@ test_that("async tasks can set an R callback", {

# Ensure the callback runs even if the task is already finished
async_called <- FALSE
sleep_task <- adbc_async_sleep(1)
sleep_task <- adbc_async_sleep(0)
Sys.sleep(0.1)
adbc_async_task_set_callback(sleep_task, function(x) { async_called <<- TRUE })
Sys.sleep(0.1)
expect_true(async_called)

# Ensure this also works on error
async_called <- FALSE
sleep_task <- adbc_async_sleep(1, error_message = "some error")
sleep_task <- adbc_async_sleep(0, error_message = "some error")
Sys.sleep(0.1)
adbc_async_task_set_callback(
sleep_task,
resolve = function(x) NULL,
Expand Down

0 comments on commit 50d6d3f

Please sign in to comment.