Running ‘testthat.R’ [12s/22s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(reservr)
  > 
  > test_check("reservr")
  ── Skip ('/data/gannet/ripley/R/packages/tests-devel/reservr.Rcheck/tests/testthat/helpers.R:13:3'): set floatx to 64-bit ──
  Reason: TensorFlow not available for testing
  
  
   *** caught segfault ***
  address 0x1, cause 'memory not mapped'
  
  Traceback:
   1: pgamma_diff_matrix(obs$xmin[i_cens], obs$xmax[i_cens], shapes,     scale)
   2: .erlang_dens_mat(obs, shapes, scale, i_obs, i_cens)
   3: .erlang_em(obs = obs, probs = as.numeric(params$probs), shapes = shapes,     scale = params$scale, min_iter = min_iter, max_iter = max_iter,     skip_first_e = skip_first_e, tolerance = tolerance, trace = trace,     parallel = parallel)
   4: em_fit(shapes, list(probs = as.list(probs), scale = scale))
   5: .erlang_shape_search(obs = obs, probs = probs, shapes = shapes,     scale = scale, min_iter = min_iter, max_iter = max_iter,     skip_first_e = skip_first_e, tolerance = tolerance, trace = trace,     parallel = parallel)
   6: fit_dist.ErlangMixtureDistribution(dist = object, obs = obs,     start = start, ...)
   7: fit_dist(dist = object, obs = obs, start = start, ...)
   8: fit.Distribution(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
   9: fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes))
  10: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  11: withVisible(code)
  12: withCallingHandlers(withVisible(code), warning = handle_warning,     message = handle_message)
  13: force(code)
  14: withr::with_output_sink(path, withCallingHandlers(withVisible(code),     warning = handle_warning, message = handle_message))
  15: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)),     ...)
  16: quasi_capture(enquo(object), NULL, evaluate_promise)
  17: expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes)))
  18: eval(code, test_env)
  19: eval(code, test_env)
  20: 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)
  21: doTryCatch(return(expr), name, parentenv, handler)
  22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  23: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  24: doTryCatch(return(expr), name, parentenv, handler)
  25: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  26: tryCatchList(expr, classes, parentenv, handlers)
  27: 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) {    })
  28: test_code(desc, code, env = parent.frame(), default_reporter = local_interactive_reporter())
  29: test_that("erlang mixture distribution works", {    set.seed(1337L)    dist <- dist_erlangmix(list(NULL, NULL, NULL))    params <- list(shapes = list(1L, 4L, 12L), scale = 2, probs = list(0.5,         0.3, 0.2))    alt_params <- list(shapes = list(2L, 6L, 100L), scale = 0.1,         probs = list(0.7, 0.2, 0.1))    x <- dist$sample(100L, with_params = params)    expect_silent(fit(dist, x, init = "shapes", shapes = as.numeric(params$shapes)))    expect_silent(fit(dist, x, init = "fan", spread = 3L))    expect_silent(fit(dist, x, init = "kmeans"))    expect_silent(fit(dist, x, init = "cmm"))    expect_identical(dist$get_type(), "continuous")    expect_density(dist, function(x, log = FALSE, ...) {        params <- list(...)        res <- (params$probs[[1L]] * dgamma(x, shape = params$shapes[[1L]],             scale = params$scale) + params$probs[[2L]] * dgamma(x,             shape = params$shapes[[2L]], scale = params$scale) +             params$probs[[3L]] * dgamma(x, shape = params$shapes[[3L]],                 scale = params$scale))/sum(as.numeric(params$probs))        if (log)             log(res)        else res    }, params, x)    expect_probability(dist, function(q, lower.tail = TRUE, log.p = FALSE,         ...) {        params <- list(...)        res <- (params$probs[[1L]] * pgamma(q, shape = params$shapes[[1L]],             scale = params$scale, lower.tail = lower.tail) +             params$probs[[2L]] * pgamma(q, shape = params$shapes[[2L]],                 scale = params$scale, lower.tail = lower.tail) +             params$probs[[3L]] * pgamma(q, shape = params$shapes[[3L]],                 scale = params$scale, lower.tail = lower.tail))/sum(as.numeric(params$probs))        if (log.p)             log(res)        else res    }, params, x)    expect_identical(dist$is_in_support(x), rep_len(TRUE, length(x)))    expect_diff_density(dist, x, params)    expect_diff_density(dist, x, alt_params)    expect_tf_logdensity(dist, params, x)    expect_tf_logdensity(dist, alt_params, x, tolerance = 1e-05)    expect_tf_logprobability(dist, params, x, x + 1)    expect_tf_logprobability(dist, params, x, rep_len(Inf, 100L))    expect_tf_logprobability(dist, params, rep_len(0, 100L),         x)    x_alt <- dist$sample(100L, with_params = alt_params)    expect_tf_logprobability(dist, alt_params, x_alt, x_alt +         1)    expect_iprobability(dist, params, x, x + 1)    expect_iprobability(dist, params, 0, x)    expect_iprobability(dist, params, x, Inf)    dist$default_params$shapes <- params$shapes    expect_tf_fit(dist, params[c("scale", "probs")], I_POSITIVE_REALS)})
  30: eval(code, test_env)
  31: eval(code, test_env)
  32: 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)
  33: doTryCatch(return(expr), name, parentenv, handler)
  34: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  35: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  36: doTryCatch(return(expr), name, parentenv, handler)
  37: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  38: tryCatchList(expr, classes, parentenv, handlers)
  39: 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) {    })
  40: test_code(test = NULL, code = exprs, env = env, default_reporter = StopReporter$new())
  41: source_file(path, env = env(env), desc = desc, error_call = error_call)
  42: FUN(X[[i]], ...)
  43: lapply(test_paths, test_one_file, env = env, desc = desc, error_call = error_call)
  44: doTryCatch(return(expr), name, parentenv, handler)
  45: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  46: tryCatchList(expr, classes, parentenv, handlers)
  47: tryCatch(code, testthat_abort_reporter = function(cnd) {    cat(conditionMessage(cnd), "\n")    NULL})
  48: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, desc = desc, error_call = error_call))
  49: test_files_serial(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,     desc = desc, load_package = load_package, error_call = error_call)
  50: 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,     load_package = load_package, parallel = parallel)
  51: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  52: test_check("reservr")
  An irrecoverable exception occurred. R is aborting now ...