Running ‘testthat.R’ [146s/230s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(rbmi)
  > 
  > test_check("rbmi")
  mmrm() registered as emmeans extension
  [ FAIL 1 | WARN 0 | SKIP 13 | PASS 1015 ]
  
  ══ Skipped tests (13) ══════════════════════════════════════════════════════════
  • On CRAN (1): 'test-mmrm.R:337:5'
  • is_full_test() is not TRUE (12): 'test-draws.R:115:5',
    'test-fullusage.R:44:5', 'test-fullusage.R:118:5', 'test-fullusage.R:210:5',
    'test-fullusage.R:301:5', 'test-fullusage.R:432:5', 'test-fullusage.R:521:5',
    'test-fullusage.R:681:5', 'test-mcmc.R:327:5', 'test-mcmc.R:503:5',
    'test-parallel.R:8:5', 'test-reproducibility.R:9:5'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-fullusage.R:926:5'): Three arms trial runs smoothly and gives expected results ──
  Error in `(function (longdata, method, sample_stack, n_target_samples, 
      first_sample_orig, use_samp_ids, failure_limit = 0, ncores = 1, 
      quiet = FALSE) 
  {
      max_sample_attempts <- n_target_samples + failure_limit
      assert_that(length(sample_stack$stack) >= max_sample_attempts, 
          msg = sprintf("Only %s samples in the sample_stack, %s are required", 
              length(sample_stack$stack), max_sample_attempts))
      time_taken <- system.time({
          initial_sample <- get_mmrm_sample(ids = longdata$ids, 
              longdata = longdata, method = method)
      })
      if (initial_sample$failed) {
          stop("Fitting MMRM to original dataset failed")
      }
      if (!quiet) {
          cat(sprintf("\nEstimated running time (assuming single core) is %s seconds\n\n", 
              round(time_taken[[3]] * n_target_samples, 2)))
      }
      cl <- get_cluster(ncores)
      mmrm_sample <- encap_get_mmrm_sample(cl, longdata, method)
      samples <- list()
      n_failed_samples <- 0
      logger <- progressLogger$new(n_target_samples, quiet = quiet)
      while (length(samples) < n_target_samples) {
          ids <- sample_stack$pop(min(ncores, n_target_samples - 
              length(samples)))
          new_samples <- mmrm_sample(ids)
          isfailure <- vapply(new_samples, function(x) x$failed, 
              logical(1))
          new_samples_keep <- new_samples[!isfailure]
          n_failed_samples <- n_failed_samples + sum(isfailure)
          if (n_failed_samples > failure_limit) {
              if (!is.null(cl)) 
                  parallel::stopCluster(cl)
              if (!is.null(method$type)) {
                  if (method$type == "jackknife") {
                    ids_fail <- ids[isfailure][[1]]
                    ids_jack <- longdata$ids[!longdata$ids %in% 
                      ids_fail][[1]]
                    msg <- "MMRM failed to fit to the data after removing subject '%s'"
                    stop(sprintf(msg, ids_jack))
                  }
              }
              msg <- "More than %s failed fits. Try using a simpler covariance structure"
              stop(sprintf(msg, failure_limit))
          }
          logger$add(length(new_samples_keep))
          samples <- append(samples, new_samples_keep)
      }
      if (!is.null(cl)) 
          parallel::stopCluster(cl)
      assert_that(length(samples) == n_target_samples, msg = "Incorrect number of samples were produced")
      if (first_sample_orig) {
          samples <- append(list(initial_sample), samples)
      }
      if (!use_samp_ids) {
          for (i in seq_along(samples)) {
              samples[[i]]$ids <- longdata$ids
          }
      }
      ret <- as_draws(method = method, samples = sample_list(samples), 
          data = longdata, formula = longdata$formula, n_failures = n_failed_samples)
      return(ret)
  })(longdata = <environment>, method = structure(list(covariance = "us", 
      threshold = 0.01, same_cov = FALSE, REML = TRUE, type = "bootstrap", 
      n_samples = 0), class = c("method", "condmean")), ncores = 1, 
      first_sample_orig = TRUE, use_samp_ids = TRUE, quiet = TRUE, 
      n_target_samples = 0, failure_limit = 0, sample_stack = <environment>)`: Fitting MMRM to original dataset failed
  Backtrace:
      ▆
   1. ├─rbmi::draws(...) at test-fullusage.R:926:5
   2. └─rbmi:::draws.condmean(...)
   3.   ├─base::do.call(get_draws_mle, sample_opts)
   4.   └─rbmi (local) `<fn>`(...)
  
  [ FAIL 1 | WARN 0 | SKIP 13 | PASS 1015 ]
  Error: Test failures
  Execution halted