Running ‘testthat.R’ [7s/22s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(DesignLibrary)
  Loading required package: DeclareDesign
  Loading required package: randomizr
  Loading required package: fabricatr
  Loading required package: estimatr
  > 
  > test_check(package = "DesignLibrary")
  [1] "The implied ICC in (control) is 0.667"
  [1] "The implied ICC in (control) conditional on block is  0.5"
  
   *** caught segfault ***
  address fcccb639, cause 'memory not mapped'
  
  Traceback:
   1: demeanMat(Y = as.matrix(model_data[["outcome"]]), X = model_data[["design_matrix"]],     Zmat = model_data[["instrument_matrix"]], fes = model_data[["fixed_effects"]],     weights = if (is.numeric(model_data[["weights"]])) model_data[["weights"]] else rep(1,         nrow(model_data[["design_matrix"]])), has_int = attr(model_data$terms,         "intercept"), eps = 1e-08)
   2: demean_fes(model_data)
   3: model(~(Y ~ Z), fixed_effects = ~~blocks, clusters = ~clusters,     data = data)
   4: eval_tidy(quo(model(!!!args, data = data)))
   5: estimator_function(data, ~(Y ~ Z), fixed_effects = ~~blocks,     clusters = ~clusters, model = ~lm_robust)
   6: eval_tidy(quo(estimator_function(data, !!!dots)))
   7: (FUN)(data = data, ~(Y ~ Z), estimand = ~estimand, model = ~lm_robust,     fixed_effects = ~~blocks, clusters = ~clusters, label = ~"estimator")
   8: eval_tidy(quo, data = list(data = data))
   9: step(current_df)
  10: doTryCatch(return(expr), name, parentenv, handler)
  11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  12: tryCatchList(expr, classes, parentenv, handlers)
  13: tryCatch(nxt <- step(current_df), error = function(err) {    stop(simpleError(sprintf("Error in step %d (%s):\n\t%s",         i, attr(step, "label") %||% "", err)))})
  14: next_step(step, current_df, i)
  15: run_design_internal.design(design)
  16: run_design_internal(design)
  17: run_design(design)
  18: FUN(X[[i]], ...)
  19: lapply(...)
  20: future_lapply(seq_len(sims), function(i) run_design(design),     future.seed = NA, future.globals = "design")
  21: (function (design, sims) {    if (!is_bare_integerish(sims) || (length(design) != length(sims) &         length(sims) != 1)) {        stop("Please provide sims a scalar or a numeric vector of length the number of steps in designs.",             call. = FALSE)    }    if (min(sims) < 1) {        stop("Sims should be >= 1", call. = FALSE)    }    if (sims[1] < 30 && !identical(Sys.getenv("TESTTHAT"), "true")) {        warning("We recommend you choose a higher number of simulations than ",             sims[1], " for the top level of simulation.", call. = FALSE)    }    if (prod(sims) == 1)         sims <- 1    if (length(sims) == 1 && is.null(names(sims))) {        results_list <- future_lapply(seq_len(sims), function(i) run_design(design),             future.seed = NA, future.globals = "design")    }    else {        sims <- check_sims(design, sims)        results_list <- fan_out(design, sims)    }    results2x <- function(results_list, what) {        subresult <- lapply(results_list, `[[`, what)        df <- rbind_disjoint(subresult)        if (nrow(df) == 0) {            return(df)        }        df <- cbind(sim_ID = rep(seq_along(subresult), vapply(subresult,             nrow, 0L)), df)    }    estimates_df <- results2x(results_list, "estimates_df")    estimands_df <- results2x(results_list, "estimands_df")    if (is_empty(estimates_df) && is_empty(estimands_df)) {        stop("No estimates or estimands were declared, so design cannot be simulated.",             call. = FALSE)    }    else if (is_empty(estimands_df)) {        simulations_df <- estimates_df    }    else if (is_empty(estimates_df)) {        simulations_df <- estimands_df    }    else if (all(estimands_df$estimand_label %in% estimates_df$estimand_label) &         all(estimates_df$estimand_label %in% estimands_df$estimand_label)) {        estimands_df_split <- split(x = estimands_df, f = estimands_df$estimand_label)        estimates_df_split <- split(x = estimates_df, f = estimates_df$estimand_label)        non_missing_columns <- function(dat) {            nonmissing <- apply(dat, 2, FUN = function(x) any(!is.na(x)))            return(dat[, nonmissing, drop = FALSE])        }        estimands_df_split <- lapply(estimands_df_split, non_missing_columns)        estimates_df_split <- lapply(estimates_df_split, non_missing_columns)        by_split <- lapply(X = seq_along(estimands_df_split),             FUN = function(x) {                colnames(estimands_df_split[[x]]) %icn% estimates_df_split[[x]]            })        simulations_df_split <- mapply(FUN = merge, x = estimands_df_split,             y = estimates_df_split, by = by_split, MoreArgs = list(all = TRUE,                 sort = FALSE), SIMPLIFY = FALSE)        simulations_df <- rbind_disjoint(simulations_df_split)    }    else {        simulations_df <- merge(estimands_df, estimates_df, by = colnames(estimands_df) %icn%             estimates_df, all = TRUE, sort = FALSE)        if (nrow(simulations_df) > max(nrow(estimands_df), nrow(estimates_df))) {            warning("Estimators lack estimand/term labels for matching, a many-to-many merge was performed.")        }    }    simulations_df})(design = dots[[1L]][[1L]], sims = dots[[2L]][[1L]])
  22: mapply(design = designs, sims = sims, FUN = simulate_single_design,     SIMPLIFY = FALSE)
  23: simulate_design(!!!dots, sims = sims)
  24: DeclareDesign::diagnose_design(one_design, sims = 10, bootstrap_sims = FALSE)
  25: eval_bare(get_expr(quo), get_env(quo))
  26: quasi_label(enquo(object), label)
  27: expect_is(DeclareDesign::diagnose_design(one_design, sims = 10,     bootstrap_sims = FALSE)$diagnosands_df, "data.frame")
  28: eval(code, test_env)
  29: eval(code, test_env)
  30: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  31: doTryCatch(return(expr), name, parentenv, handler)
  32: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  33: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  34: doTryCatch(return(expr), name, parentenv, handler)
  35: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  36: tryCatchList(expr, classes, parentenv, handlers)
  37: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  38: test_code(desc, code, env = parent.frame())
  39: testthat::test_that(desc = paste0(designer, "'s default design runs."),     code = {        expect_is(DeclareDesign::diagnose_design(one_design,             sims = 10, bootstrap_sims = FALSE)$diagnosands_df,             "data.frame")    })
  40: eval(code, test_env)
  41: eval(code, test_env)
  42: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  43: doTryCatch(return(expr), name, parentenv, handler)
  44: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  45: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  46: doTryCatch(return(expr), name, parentenv, handler)
  47: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  48: tryCatchList(expr, classes, parentenv, handlers)
  49: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  50: test_code(NULL, exprs, env)
  51: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  52: force(code)
  53: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        end_context()    })
  54: FUN(X[[i]], ...)
  55: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  56: force(code)
  57: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  58: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  59: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap)
  60: test_package_dir(package = package, test_path = test_path, filter = filter,     reporter = reporter, ..., stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  61: test_check(package = "DesignLibrary")
  An irrecoverable exception occurred. R is aborting now ...