Running ‘testthat.R’ [88s/174s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > testthat::test_check("PosteriorBootstrap")
  Loading required package: PosteriorBootstrap
  Welcome to PosteriorBootstrap, a parallel approach for adaptive non-parametric learning
  Chain 1: ------------------------------------------------------------
  Chain 1: EXPERIMENTAL ALGORITHM:
  Chain 1:   This procedure has not been thoroughly tested and may be unstable
  Chain 1:   or buggy. The interface is subject to change.
  Chain 1: ------------------------------------------------------------
  Chain 1: 
  Chain 1: 
  Chain 1: 
  Chain 1: Gradient evaluation took 0.000981 seconds
  Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 9.81 seconds.
  Chain 1: Adjust your expectations accordingly!
  Chain 1: 
  Chain 1: 
  Chain 1: Begin eta adaptation.
  Chain 1: Iteration:   1 / 250 [  0%]  (Adaptation)
  Chain 1: Iteration:  50 / 250 [ 20%]  (Adaptation)
  Chain 1: Iteration: 100 / 250 [ 40%]  (Adaptation)
  Chain 1: Iteration: 150 / 250 [ 60%]  (Adaptation)
  Chain 1: Iteration: 200 / 250 [ 80%]  (Adaptation)
  Chain 1: Success! Found best value [eta = 1] earlier than expected.
  Chain 1: 
  Chain 1: Begin stochastic gradient ascent.
  Chain 1:   iter             ELBO   delta_ELBO_mean   delta_ELBO_med   notes 
  Chain 1:    100         -593.338             1.000            1.000
  Chain 1:    200         -591.578             0.501            1.000
  Chain 1:    300         -593.057             0.335            0.003   MEDIAN ELBO CONVERGED
  Chain 1: 
  Chain 1: Drawing a sample of size 100 from the approximate posterior... 
  Chain 1: COMPLETED.
  
   *** caught segfault ***
  address 0x200000002, cause 'memory not mapped'
  
  Traceback:
   1: .External(list(name = "CppMethod__invoke_notvoid", address = <pointer: 0x708b2c0>,     dll = list(name = "Rcpp", path = "/data/gannet/ripley/R/test-clang/Rcpp/libs/Rcpp.so",         dynamicLookup = TRUE, handle = <pointer: 0x21e9dc0>,         info = <pointer: 0x40585b0>), numParameters = -1L), <pointer: 0x32376f0>,     <pointer: 0x5845730>, .pointer, ...)
   2: sampler$call_sampler(c(args, dotlist))
   3: .local(object, ...)
   4: rstan::vb(object = stan_model, data = train_dat, seed = seed,     output_samples = n_bootstrap)
   5: rstan::vb(object = stan_model, data = train_dat, seed = seed,     output_samples = n_bootstrap)
   6: withCallingHandlers(expr, warning = function(w) if (inherits(w,     classes)) tryInvokeRestart("muffleWarning"))
   7: suppressWarnings(stan_vb <- rstan::vb(object = stan_model, data = train_dat,     seed = seed, output_samples = n_bootstrap))
   8: eval(code, test_env)
   9: eval(code, test_env)
  10: 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)
  11: doTryCatch(return(expr), name, parentenv, handler)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  14: doTryCatch(return(expr), name, parentenv, handler)
  15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  16: tryCatchList(expr, classes, parentenv, handlers)
  17: 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) {    })
  18: test_code(desc, code, env = parent.frame(), reporter = reporter)
  19: test_that("Adaptive non-parametric learning with posterior samples works",     {        skip_on_os(c("windows"))        german <- get_german_credit_dataset()        n_bootstrap <- 100        seed <- 123        prior_sd <- 10        train_dat <- list(n = length(german$y), p = ncol(german$x),             x = german$x, y = german$y, beta_sd = prior_sd)        stan_model <- rstan::stan_model(file = get_stan_file())        suppressWarnings(stan_vb <- rstan::vb(object = stan_model,             data = train_dat, seed = seed, output_samples = n_bootstrap))        stan_vb_sample <- rstan::extract(stan_vb)$beta        anpl_samples <- draw_logit_samples(x = german$x, y = german$y,             concentration = 1, n_bootstrap = n_bootstrap, posterior_sample = stan_vb_sample,             threshold = 1e-08)        col_means <- colMeans(anpl_samples)        print(col_means[21])        print(col_means[22])        ok21 <- (col_means[21] >= 0.05) && (col_means[21] <=             0.4)        ok22 <- (col_means[22] >= -0.3) && (col_means[22] <=             0)        expect_true(ok21, "The average coefficient for column 21 is as expected")        expect_true(ok22, "The average coefficient for column 22 is as expected")    })
  20: eval(code, test_env)
  21: eval(code, test_env)
  22: 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)
  23: doTryCatch(return(expr), name, parentenv, handler)
  24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  26: doTryCatch(return(expr), name, parentenv, handler)
  27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  28: tryCatchList(expr, classes, parentenv, handlers)
  29: 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) {    })
  30: test_code(NULL, exprs, env)
  31: source_file(path, child_env(env), wrap = wrap)
  32: FUN(X[[i]], ...)
  33: lapply(test_paths, test_one_file, env = env, wrap = wrap)
  34: force(code)
  35: doWithOneRestart(return(expr), restart)
  36: withOneRestart(expr, restarts[[1L]])
  37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  38: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, wrap = wrap))
  39: 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)
  40: 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)
  41: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  42: testthat::test_check("PosteriorBootstrap")
  An irrecoverable exception occurred. R is aborting now ...