Running ‘testthat.R’ [28s/63s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(motherduck)
  > library(DBI)
  > library(openxlsx)
  > 
  > test_check("motherduck")
  duckdb is keeping downloaded extensions in a temporary directory:
  i /tmp/RtmpCpcPnn/working_dir/RtmpLn1ERT/duckdb/extensions
  This is removed when the R session ends, so extensions are re-downloaded each session.
  i To keep them, point `options(duckdb.extension_directory =)` or the `DUCKDB_EXTENSION_DIRECTORY` environment variable at a permanent path.
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 0
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 0
  * # Tables in this catalog & schema you have access to: 0
  
  -- Action Report: --
  
  v Inserted into existing database "memory"
  v Created new schema "test_schema"
  > Current role: `duckdb`
  
  -- Status: ---------------------------------------------------------------------
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "test_schema"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 0
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 0
  * # Tables in this catalog & schema you have access to: 0
  > Current role: `duckdb`
  > Current role: `duckdb`
  > Current role: `duckdb`
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 1
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 1
  * # Tables in this catalog & schema you have access to: 1
  
  -- Action Report: --
  
  v Inserted into existing database "memory"
  v Using existing schema "main"
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 1
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 1
  * # Tables in this catalog & schema you have access to: 1
  
  -- Action Report: --
  
  v Inserted into existing database "memory"
  v Using existing schema "main"
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 1
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 1
  * # Tables in this catalog & schema you have access to: 1
  
  -- Action Report: --
  
  v Inserted into existing database "memory"
  v Using existing schema "main"
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 3
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 3
  * # Tables in this catalog & schema you have access to: 3
  
  -- Action Report: --
  
  v Inserted into existing database "memory"
  v Using existing schema "main"
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 3
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 3
  * # Tables in this catalog & schema you have access to: 3
  
  -- Action Report: --
  
  v Inserted into existing database "memory"
  v Using existing schema "main"
  Note: method with signature 'DBIConnection#Id' chosen for function 'dbExistsTable',
   target signature 'duckdb_connection#Id'.
   "duckdb_connection#ANY" would also be valid
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 0
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 0
  * # Tables in this catalog & schema you have access to: 0
  
  -- Action Report: 
  * Deleted "delete_table" from "[database_name]" in "main"
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 0
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 0
  * # Tables in this catalog & schema you have access to: 0
  
  -- Action Report: --
  
  v Inserted into existing database "memory"
  v Created new schema "test_schema"
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 1
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 1
  * # Tables in this catalog & schema you have access to: 0
  
  -- Action Report: --
  
  * Deleted "test_schema" schema and 1 tables
  
  -- Status: ---------------------------------------------------------------------
  
  -- Connection Status Report: --
  
  ! You are not connected to MotherDuck
  
  -- User Report: --
  
  * User Name: "duckdb"
  * Role: "duckdb"
  
  -- Catalog Report: --
  
  * Current Database: "memory"
  * Current Schema: "main"
  * # Total Catalogs you have access to: 3
  * # Total Tables you have access to: 0
  * # Total Shares you have access to: 0
  * # Tables in this catalog you have access to: 0
  * # Tables in this catalog & schema you have access to: 0
  
  -- Action Report: --
  
  * Deleted "test_schema" schema and 1 tables
  
  -- Action Report: --
  
  v Inserted into existing database "memory"
  v Using existing schema "main"
  v Overwrite existing table "mtcars_csv"
  
   *** caught segfault ***
  address 0x4f96, cause 'memory not mapped'
  
  Traceback:
   1: rapi_execute(stmt, convert_opts)
   2: withCallingHandlers(expr, condition = function(cnd) {    {        .__handler_frame__. <- TRUE        .__setup_frame__. <- frame        if (inherits(cnd, "message")) {            except <- c("warning", "error")        }        else if (inherits(cnd, "warning")) {            except <- "error"        }        else {            except <- ""        }    }    while (!is_null(cnd)) {        if (inherits(cnd, "error")) {            out <- handlers[[1L]](cnd)            if (!inherits(out, "rlang_zap"))                 throw(out)        }        inherit <- .subset2(.subset2(cnd, "rlang"), "inherit")        if (is_false(inherit)) {            return()        }        cnd <- .subset2(cnd, "parent")    }})
   3: doTryCatch(return(expr), name, parentenv, handler)
   4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   5: tryCatchList(expr, classes, parentenv, handlers)
   6: tryCatch(withCallingHandlers(expr, condition = function(cnd) {    {        .__handler_frame__. <- TRUE        .__setup_frame__. <- frame        if (inherits(cnd, "message")) {            except <- c("warning", "error")        }        else if (inherits(cnd, "warning")) {            except <- "error"        }        else {            except <- ""        }    }    while (!is_null(cnd)) {        if (inherits(cnd, "error")) {            out <- handlers[[1L]](cnd)            if (!inherits(out, "rlang_zap"))                 throw(out)        }        inherit <- .subset2(.subset2(cnd, "rlang"), "inherit")        if (is_false(inherit)) {            return()        }        cnd <- .subset2(cnd, "parent")    }}), stackOverflowError = handlers[[1L]])
   7: rlang::try_fetch(rapi_execute(stmt, convert_opts), error = function(e) {    rethrow_error_from_rapi(e, call)})
   8: rethrow_rapi_execute(res@stmt_lst$ref, duckdb_convert_opts_impl(res@connection@convert_opts,     arrow = res@arrow))
   9: duckdb_execute(res)
  10: duckdb_result(connection = conn, stmt_lst = stmt_lst, arrow = arrow)
  11: .local(conn, statement, ...)
  12: dbSendQuery(conn, statement, ...)
  13: dbSendQuery(conn, statement, ...)
  14: dbSendStatement(conn, statement, ...)
  15: dbSendStatement(conn, statement, ...)
  16: DBI::dbExecute(.con, glue::glue("LOAD {x};"))
  17: DBI::dbExecute(.con, glue::glue("LOAD {x};"))
  18: .f(.x[[i]], ...)
  19: .Primitive(".Call")(list(name = "map_impl", address = <pointer: 0x56362174def0>,     dll = list(name = "purrr", path = "/data/gannet/ripley/R/test-clang/purrr/libs/purrr.so",         dynamicLookup = FALSE, handle = <pointer: 0x563621765570>,         info = <pointer: 0x7f26240055c0>, forceSymbols = FALSE),     numParameters = 6L), <environment>, "list", FALSE, 1L, NULL,     1L)
  20: call_with_cleanup(map_impl, environment(), .type, .progress,     n, names, i)
  21: withCallingHandlers(expr, error = function(cnd) {    if (i == 0L) {    }    else {        message <- c(i = "In index: {i}.")        if (!is.null(names) && !is.na(names[[i]]) && names[[i]] !=             "") {            name <- names[[i]]            message <- c(message, i = "With name: {name}.")        }        else {            name <- NULL        }        cli::cli_abort(message, location = i, name = name, parent = cnd,             call = error_call, class = "purrr_error_indexed")    }})
  22: with_indexed_errors(i = i, names = names, error_call = .purrr_error_call,     call_with_cleanup(map_impl, environment(), .type, .progress,         n, names, i))
  23: map_("list", .x, .f, ..., .progress = .progress)
  24: purrr::map(ext_lst$valid_ext, function(x) DBI::dbExecute(.con,     glue::glue("LOAD {x};")))
  25: load_extensions(.con, "excel")
  26: read_excel(.con = con_db, to_database_name = "memory", to_schema_name = "main",     to_table_name = "mtcars_excel", file_path = file_name, write_type = "overwrite")
  27: eval(code, test_env)
  28: eval(code, test_env)
  29: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
  30: doTryCatch(return(expr), name, parentenv, handler)
  31: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  32: tryCatchList(expr, classes, parentenv, handlers)
  33: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  34: doWithOneRestart(return(expr), restart)
  35: withOneRestart(expr, restarts[[1L]])
  36: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  37: test_code(code, parent.frame())
  38: it("successfully reads a excel and copies table to database",     {        file_name <- tempfile()        openxlsx::write.xlsx(mtcars, file_name)        con_db <- DBI::dbConnect(duckdb::duckdb())        read_excel(.con = con_db, to_database_name = "memory",             to_schema_name = "main", to_table_name = "mtcars_excel",             file_path = file_name, write_type = "overwrite")        list_of_tables <- dplyr::collect(list_all_tables(con_db))        testthat::expect_true(all(list_of_tables[["table_name"]] %in%             "mtcars_excel"))        DBI::dbDisconnect(con_db)    })
  39: eval(code, test_env)
  40: eval(code, test_env)
  41: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
  42: doTryCatch(return(expr), name, parentenv, handler)
  43: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  44: tryCatchList(expr, classes, parentenv, handlers)
  45: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  46: doWithOneRestart(return(expr), restart)
  47: withOneRestart(expr, restarts[[1L]])
  48: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  49: test_code(code, parent.frame())
  50: describe("read_excel", {    it("successfully reads a excel and copies table to database",         {            file_name <- tempfile()            openxlsx::write.xlsx(mtcars, file_name)            con_db <- DBI::dbConnect(duckdb::duckdb())            read_excel(.con = con_db, to_database_name = "memory",                 to_schema_name = "main", to_table_name = "mtcars_excel",                 file_path = file_name, write_type = "overwrite")            list_of_tables <- dplyr::collect(list_all_tables(con_db))            testthat::expect_true(all(list_of_tables[["table_name"]] %in%                 "mtcars_excel"))            DBI::dbDisconnect(con_db)        })})
  51: eval(code, test_env)
  52: eval(code, test_env)
  53: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
  54: doTryCatch(return(expr), name, parentenv, handler)
  55: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  56: tryCatchList(expr, classes, parentenv, handlers)
  57: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  58: doWithOneRestart(return(expr), restart)
  59: withOneRestart(expr, restarts[[1L]])
  60: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  61: test_code(code = exprs, env = env, reporter = get_reporter() %||%     StopReporter$new())
  62: source_file(path, env = env(env), desc = desc, shuffle = shuffle,     error_call = error_call)
  63: FUN(X[[i]], ...)
  64: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle,     error_call = error_call)
  65: doTryCatch(return(expr), name, parentenv, handler)
  66: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  67: tryCatchList(expr, classes, parentenv, handlers)
  68: tryCatch(code, testthat_abort_reporter = function(cnd) {    cat(conditionMessage(cnd), "\n")    NULL})
  69: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, desc = desc, shuffle = shuffle, error_call = error_call))
  70: test_files_serial(test_dir = test_dir, test_package = test_package,     test_paths = test_paths, load_helpers = load_helpers, reporter = reporter,     env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     desc = desc, load_package = load_package, shuffle = shuffle,     error_call = error_call)
  71: test_files(test_dir = path, test_paths = test_paths, test_package = package,     reporter = reporter, load_helpers = load_helpers, env = env,     stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     load_package = load_package, parallel = parallel, shuffle = shuffle)
  72: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  73: test_check("motherduck")
  An irrecoverable exception occurred. R is aborting now ...