Running ‘testthat.R’ [21s/52s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(metaSEM)
  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)
  "SLSQP" is set as the default optimizer in OpenMx.
  mxOption(NULL, "Gradient algorithm") is set at "central".
  mxOption(NULL, "Optimality tolerance") is set at "6.3e-14".
  mxOption(NULL, "Gradient iterations") is set at "2".
  > 
  > test_check("metaSEM")
  Error: C stack usage  279745684 is too close to the limit
  <simpleError: The job for model 'Asymptotic covariance matrix of correlation matrix' exited abnormally with the error message: User interrupt>
  ── ERROR (test_utilities.R:336:5): Cor2DataFrame() works correctly ─────────────
  Error: The job for model 'Asymptotic covariance matrix of correlation matrix' exited abnormally with the error message: User interrupt
  Backtrace:
      █
   1. └─metaSEM::Cor2DataFrame(Nohe15A1$data, Nohe15A1$n) test_utilities.R:336:4
   2.   └─metaSEM::asyCov(...)
   3.     └─base::mapply(...)
   4.       └─(function (x, n, cor.analysis = TRUE, dropNA = FALSE, as.matrix = TRUE, ...
  
  ── FAILURE (test_utilities.R:567:5): metaFIML() works correctly ────────────────
  `coef1a` not equal to `coef1b`.
  5/5 mismatches (average diff: 0.142)
  [1] 0.100 -  0.01560 == 0.08440
  [2] 0.100 -  0.00391 == 0.09609
  [3] 0.692 -  0.59805 == 0.09415
  [4] 0.100 - -0.32955 == 0.42955
  [5] 0.870 -  0.86395 == 0.00605
  
  ── Warning (test_utilities.R:568:5): metaFIML() works correctly ────────────────
  Error in solving the Hessian matrix. Generalized inverse is used. The standard errors may not be trustworthy.
  
  
  ── FAILURE (test_utilities.R:569:5): metaFIML() works correctly ────────────────
  fit1a$mx.fit$output$Minus2LogLikelihood not equal to fit1b$output$Minus2LogLikelihood.
  1/1 mismatches
  [1] 111 - -155 == 266
  
  ── Warning (test_utilities.R:602:5): metaFIML() works correctly ────────────────
  Error in solving the Hessian matrix. Generalized inverse is used. The standard errors may not be trustworthy.
  
  
  ── FAILURE (test_utilities.R:604:5): metaFIML() works correctly ────────────────
  `v_fit2a` not equal to `v_fit2b`.
  3/64 mismatches (average diff: 1.93)
  [48] -9.78e-07 - -0.00862 ==  0.00862
  [62] -9.78e-07 - -0.00862 ==  0.00862
  [64]  1.01e-08 -  5.77357 == -5.77357
  
  
   *** caught segfault ***
  address 0, cause 'memory not mapped'
  
  Traceback:
   1: runHelper(model, frontendStart, intervals, silent, suppressWarnings,     unsafe, checkpoint, useSocket, onlyFrontend, useOptimizer,     beginMessage)
   2: mxRun(mx.model, intervals = FALSE, suppressWarnings = suppressWarnings,     silent = silent, ...)
   3: doTryCatch(return(expr), name, parentenv, handler)
   4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   5: tryCatchList(expr, classes, parentenv, handlers)
   6: tryCatch(mxRun(mx.model, intervals = FALSE, suppressWarnings = suppressWarnings,     silent = silent, ...), error = function(e) e)
   7: metaFIML(y = y, v = v, x = x, av = av, data = my.df, model.name = "No predictor",     coef.constraints = matrix(0, nrow = no.y, ncol = no.x), suppressWarnings = TRUE,     R2 = FALSE, silent = TRUE)
   8: doTryCatch(return(expr), name, parentenv, handler)
   9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  10: tryCatchList(expr, classes, parentenv, handlers)
  11: tryCatch(metaFIML(y = y, v = v, x = x, av = av, data = my.df,     model.name = "No predictor", coef.constraints = matrix(0,         nrow = no.y, ncol = no.x), suppressWarnings = TRUE, R2 = FALSE,     silent = TRUE), error = function(e) e)
  12: metaFIML(y = cbind(lifesat, lifecon), v = cbind(lifesat_var,     inter_cov, lifecon_var), x = gnp, data = wvs94a)
  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("metaFIML() works correctly", {    fit1a <- metaFIML(y = r, v = r_v, x = JP_alpha, data = Jaramillo05)    m1 <- "fy =~ 1*r\n           r ~~ data.r_v*r\n           fx =~ 1*JP_alpha\n           JP_alpha ~~ 0*JP_alpha\n           fy ~ Slope1_1*fx\n           fy ~~ Tau2_1_1*fy\n           fx ~~ CovX1_X1*fx\n           fx ~ MeanX1*1\n           fy ~ Intercept1*1"    RAM1 <- lavaan2RAM(m1, obs.variables = c("r", "JP_alpha"),         std.lv = FALSE)    fit1b <- create.mxModel(RAM = RAM1, data = Jaramillo05)    coef1a <- coef(fit1a)    names1 <- names(coef1a)    coef1b <- coef(fit1b)[names1]    tolerance <- 0.001    expect_equal(coef1a, coef1b, tolerance = tolerance)    expect_equal(vcov(fit1a), vcov(fit1b)[names1, names1], tolerance = tolerance)    expect_equal(fit1a$mx.fit$output$Minus2LogLikelihood, fit1b$output$Minus2LogLikelihood)    fit2a <- metaFIML(y = r, v = r_v, x = JP_alpha, av = IDV,         data = Jaramillo05)    m2 <- "fy =~ 1*r\n           r ~~ data.r_v*r\n           fx =~ 1*JP_alpha\n           JP_alpha ~~ 0*JP_alpha\n           fy ~ Slope1_1*fx\n           fy ~~ Tau2_1_1*fy\n           fx ~~ CovX1_X1*fx\n           fx ~ MeanX1*1\n           fy ~ Intercept1*1\n\n           fz =~ 1*IDV\n           IDV ~~ 0*IDV\n           fz ~ MeanX2*1\n           fz ~~ CovX2_X2*fz + start(818)*fz\n           fx ~~ CovX2_X1*fz\n           fy ~~ CovX2_Y1*fz"    RAM2 <- lavaan2RAM(m2, obs.variables = c("r", "JP_alpha",         "IDV"), std.lv = FALSE)    fit2b <- create.mxModel(RAM = RAM2, data = Jaramillo05)    coef2a <- coef(fit2a)    names2 <- names(coef2a)    coef2b <- coef(fit2b)[names2]    expect_equal(coef2a, coef2b, tolerance = tolerance)    v_fit2a <- vcov(fit2a)[-4, -4]    v_fit2b <- vcov(fit2b)[names2, names2][-4, -4]    expect_equal(v_fit2a, v_fit2b, tolerance = tolerance)    expect_equal(fit2a$mx.fit$output$Minus2LogLikelihood, fit2b$output$Minus2LogLikelihood)    wvs94a$gnp <- scale(wvs94a$gnp)    fit3a <- metaFIML(y = cbind(lifesat, lifecon), v = cbind(lifesat_var,         inter_cov, lifecon_var), x = gnp, data = wvs94a)    m3 <- "fy1 =~ 1*lifesat\n           lifesat ~~ data.lifesat_var*lifesat\n           fy2 =~ 1*lifecon\n           lifecon ~~ data.lifecon_var*lifecon\n           lifesat ~~ data.inter_cov*lifecon\n\n           fx =~ 1*gnp\n           gnp ~~ 0*gnp\n           fy1 ~ Slope1_1*fx\n           fy2 ~ Slope2_1*fx\n\n           fy1 ~~ Tau2_1_1*fy1\n           fy2 ~~ Tau2_2_2*fy2\n           fy1 ~~ Tau2_2_1*fy2\n           fx ~~ CovX1_X1*fx\n           fx ~ MeanX1*1\n           fy1 ~ Intercept1*1\n           fy2 ~ Intercept2*1"    RAM3 <- lavaan2RAM(m3, obs.variables = c("lifesat", "lifecon",         "gnp"), std.lv = FALSE)    fit3b <- create.mxModel(RAM = RAM3, data = wvs94a)    coef3a <- coef(fit3a)    names3 <- names(coef3a)    coef3b <- coef(fit3b)[names3]    expect_equal(coef3a, coef3b, tolerance = tolerance)    expect_equal(vcov(fit3a), vcov(fit3b)[names3, names3], tolerance = tolerance)    expect_equal(fit3a$mx.fit$output$Minus2LogLikelihood, fit3b$output$Minus2LogLikelihood)})
  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: force(code)
  40: doWithOneRestart(return(expr), restart)
  41: withOneRestart(expr, restarts[[1L]])
  42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  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("metaSEM")
  An irrecoverable exception occurred. R is aborting now ...