Running ‘testthat.R’ [24s/66s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ctsemOMX)
  Loading required package: ctsem
  Loading required package: Rcpp
  ctsem also changes in time, for manual run ctDocs(), for blog see https://cdriver.netlify.app/, for citation info run citation('ctsem'), for original OpenMx functionality install.packages('ctsemOMX'), and for discussion https://github.com/cdriveraus/ctsem/discussions
  Loading required package: OpenMx
  To take full advantage of multiple cores, use:
    mxOption(key='Number of Threads', value=parallel::detectCores()) #now
    Sys.setenv(OMP_NUM_THREADS=parallel::detectCores()) #before library(OpenMx)
  
  Attaching package: 'ctsemOMX'
  
  The following objects are masked from 'package:ctsem':
  
      ctFit, ctIndplot
  
  > pdf(NULL)
  >  test_check("ctsemOMX")
  Error: C stack usage  337941652 is too close to the limit
  
   *** caught segfault ***
  address 8, cause 'memory not mapped'
  
  Traceback:
   1: runHelper(model, frontendStart, intervals, silent, suppressWarnings,     unsafe, checkpoint, useSocket, onlyFrontend, useOptimizer,     beginMessage)
   2: mxRun(model = model, suppressWarnings = T, unsafe = T, silent = T,     intervals = intervals, beginMessage = T)
   3: runWithCounter(model, numdone, silent, intervals = F)
   4: doTryCatch(return(expr), name, parentenv, handler)
   5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   6: tryCatchList(expr, classes, parentenv, handlers)
   7: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call, nlines = 1L)        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        sm <- strsplit(conditionMessage(e), "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
   8: try(runWithCounter(model, numdone, silent, intervals = F))
   9: withCallingHandlers(expr, warning = function(w) if (inherits(w,     classes)) tryInvokeRestart("muffleWarning"))
  10: suppressWarnings(try(runWithCounter(model, numdone, silent, intervals = F)))
  11: mxTryHard(fit$mxobj, initialTolerance = 1e-14, initialGradientIterations = 1,     showInits = FALSE, checkHess = TRUE, greenOK = FALSE, iterationSummary = FALSE,     bestInitsOutput = FALSE, verbose = fit$ctfitargs$verbose,     extraTries = fit$ctfitargs$retryattempts, loc = 1, scale = 0.1,     paste = FALSE)
  12: ctRefineTo(dat = gd, m, retryattempts = 3, objective = "Kalman",     stationary = c("T0MEANS", "T0VAR"), carefulFit = TRUE)
  13: eval(code, test_env)
  14: eval(code, test_env)
  15: 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)
  16: doTryCatch(return(expr), name, parentenv, handler)
  17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  18: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  19: doTryCatch(return(expr), name, parentenv, handler)
  20: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  21: tryCatchList(expr, classes, parentenv, handlers)
  22: 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) {    })
  23: test_code(desc, code, env = parent.frame(), reporter = reporter)
  24: test_that("time calc", {    set.seed(4)    nsubjects = 20    TDPREDEFFECT = matrix(c(-20, 1, -1, 20), 2, 2)    gm = ctModel(Tpoints = 10, n.latent = 2, n.manifest = 3,         LAMBDA = matrix(c(1, 0, 0, 0, 1, 0.5), ncol = 2), DRIFT = matrix(c(-0.3,             0, 0, -0.05), 2, 2), DIFFUSION = diag(2, 2), CINT = matrix(c(5,             3), ncol = 1), TDPREDEFFECT = TDPREDEFFECT, TDPREDVAR = diag(0.002,             10 * 2), MANIFESTVAR = diag(0.3, 3), T0VAR = diag(2),         n.TDpred = 2, TDPREDMEANS = matrix(rep(c(1, rep(0, 4),             0, rep(0, 4)), 2), ncol = 1))    gd = ctGenerate(gm, nsubjects, burnin = 50)    m = ctModel(Tpoints = 10, n.latent = 2, n.manifest = 3, LAMBDA = matrix(c(1,         0, 0, 0, 1, 0.5), ncol = 2), DRIFT = matrix(c(-0.3, 0,         0, -0.05), 2, 2), TDPREDEFFECT = matrix(c("td1", 1, -1,         20), 2, 2), CINT = matrix(c(5, 3), ncol = 1), MANIFESTMEANS = matrix(c(0,         0, 0), ncol = 1), n.TDpred = 2)    f1 = ctRefineTo(dat = gd, m, retryattempts = 3, objective = "Kalman",         stationary = c("T0MEANS", "T0VAR"), carefulFit = TRUE)    f2 = ctRefineTo(dat = gd, m, retryattempts = 3, objective = "mxRAM",         stationary = c("T0MEANS", "T0VAR"), carefulFit = TRUE)    expect_equal(f1$mxobj$output$estimate[-1], f2$mxobj$output$estimate[-1],         tolerance = 0.001)})
  25: eval(code, test_env)
  26: eval(code, test_env)
  27: 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)
  28: doTryCatch(return(expr), name, parentenv, handler)
  29: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  30: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  31: doTryCatch(return(expr), name, parentenv, handler)
  32: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  33: tryCatchList(expr, classes, parentenv, handlers)
  34: 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) {    })
  35: test_code(NULL, exprs, env)
  36: source_file(path, child_env(env), wrap = wrap)
  37: FUN(X[[i]], ...)
  38: lapply(test_paths, test_one_file, env = env, wrap = wrap)
  39: doTryCatch(return(expr), name, parentenv, handler)
  40: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  41: tryCatchList(expr, classes, parentenv, handlers)
  42: tryCatch(code, testthat_abort_reporter = function(cnd) {    cat(conditionMessage(cnd), "\n")    NULL})
  43: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, wrap = wrap))
  44: test_files(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,     wrap = wrap, load_package = load_package)
  45: 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,     wrap = wrap, load_package = load_package, parallel = parallel)
  46: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  47: test_check("ctsemOMX")
  An irrecoverable exception occurred. R is aborting now ...