Running ‘testthat.R’ [2s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ampir)
  > 
  > test_check("ampir")
  Could not run prediction for 1 proteins because they were either too short or contained invalid amino acids
  Could not run prediction for 2 proteins because they were either too short or contained invalid amino acids
  Could not run prediction for 1 proteins because they were either too short or contained invalid amino acids
  
   *** caught segfault ***
  address 0x110, cause 'invalid permissions'
  
  Traceback:
   1: kernelMult(kernelf(object), newdata, xmatrix(object)[[p]], coef(object)[[p]])
   2: kernelMult(kernelf(object), newdata, xmatrix(object)[[p]], coef(object)[[p]])
   3: as.vector(kernelMult(kernelf(object), newdata, xmatrix(object)[[p]],     coef(object)[[p]]) - b(object)[p])
   4: .SigmoidPredict(as.vector(kernelMult(kernelf(object), newdata,     xmatrix(object)[[p]], coef(object)[[p]]) - b(object)[p]),     prob.model(object)[[p]]$A, prob.model(object)[[p]]$B)
   5: .local(object, ...)
   6: kernlab::predict(modelFit, newdata, type = "probabilities")
   7: kernlab::predict(modelFit, newdata, type = "probabilities")
   8: doTryCatch(return(expr), name, parentenv, handler)
   9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  10: tryCatchList(expr, classes, parentenv, handlers)
  11: 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))})
  12: try(kernlab::predict(modelFit, newdata, type = "probabilities"),     silent = TRUE)
  13: method$prob(modelFit = modelFit, newdata = newdata, submodels = param)
  14: probFunction(method = object$modelInfo, modelFit = object$finalModel,     newdata = newdata, preProc = object$preProcess)
  15: predict.train(model, df_features[, predictors], type = "prob")
  16: FUN(X[[i]], ...)
  17: lapply(X = S, FUN = FUN, ...)
  18: doTryCatch(return(expr), name, parentenv, handler)
  19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  20: tryCatchList(expr, classes, parentenv, handlers)
  21: 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))})
  22: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)
  23: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))
  24: FUN(X[[i]], ...)
  25: lapply(seq_len(cores), inner.do)
  26: mclapply(chunks, predict_amps_core, df, model, min_len, mc.cores = n_cores)
  27: predict_amps(test_df, n_cores = 2)
  28: eval(code, test_env)
  29: eval(code, test_env)
  30: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
  31: doTryCatch(return(expr), name, parentenv, handler)
  32: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  33: tryCatchList(expr, classes, parentenv, handlers)
  34: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  35: doWithOneRestart(return(expr), restart)
  36: withOneRestart(expr, restarts[[1L]])
  37: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  38: test_code(code, parent.frame())
  39: test_that("predict_amps works with multiple cores", {    skip_on_os("windows")    test_df <- readRDS("../testdata/xbench.rds")    result_1core <- predict_amps(test_df, n_cores = 1)    expect_equal(dim(result_1core), c(16, 3))    result_2core <- predict_amps(test_df, n_cores = 2)    expect_equal(result_1core, result_2core)})
  40: eval(code, test_env)
  41: eval(code, test_env)
  42: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
  43: doTryCatch(return(expr), name, parentenv, handler)
  44: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  45: tryCatchList(expr, classes, parentenv, handlers)
  46: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  47: doWithOneRestart(return(expr), restart)
  48: withOneRestart(expr, restarts[[1L]])
  49: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  50: test_code(code = exprs, env = env, reporter = get_reporter() %||%     StopReporter$new())
  51: source_file(path, env = env(env), desc = desc, shuffle = shuffle,     error_call = error_call)
  52: FUN(X[[i]], ...)
  53: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle,     error_call = error_call)
  54: doTryCatch(return(expr), name, parentenv, handler)
  55: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  56: tryCatchList(expr, classes, parentenv, handlers)
  57: tryCatch(code, testthat_abort_reporter = function(cnd) {    cat(conditionMessage(cnd), "\n")    NULL})
  58: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, desc = desc, shuffle = shuffle, error_call = error_call))
  59: 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, shuffle = shuffle,     error_call = error_call)
  60: 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, shuffle = shuffle)
  61: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  62: test_check("ampir")
  An irrecoverable exception occurred. R is aborting now ...
  
   *** caught segfault ***
  address 0x110, cause 'invalid permissions'
  
  Traceback:
   1: kernelMult(kernelf(object), newdata, xmatrix(object)[[p]], coef(object)[[p]])
   2: kernelMult(kernelf(object), newdata, xmatrix(object)[[p]], coef(object)[[p]])
   3: as.vector(kernelMult(kernelf(object), newdata, xmatrix(object)[[p]],     coef(object)[[p]]) - b(object)[p])
   4: .SigmoidPredict(as.vector(kernelMult(kernelf(object), newdata,     xmatrix(object)[[p]], coef(object)[[p]]) - b(object)[p]),     prob.model(object)[[p]]$A, prob.model(object)[[p]]$B)
   5: .local(object, ...)
   6: kernlab::predict(modelFit, newdata, type = "probabilities")
   7: kernlab::predict(modelFit, newdata, type = "probabilities")
   8: doTryCatch(return(expr), name, parentenv, handler)
   9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  10: tryCatchList(expr, classes, parentenv, handlers)
  11: 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))})
  12: try(kernlab::predict(modelFit, newdata, type = "probabilities"),     silent = TRUE)
  13: method$prob(modelFit = modelFit, newdata = newdata, submodels = param)
  14: probFunction(method = object$modelInfo, modelFit = object$finalModel,     newdata = newdata, preProc = object$preProcess)
  15: predict.train(model, df_features[, predictors], type = "prob")
  16: FUN(X[[i]], ...)
  17: lapply(X = S, FUN = FUN, ...)
  18: doTryCatch(return(expr), name, parentenv, handler)
  19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  20: tryCatchList(expr, classes, parentenv, handlers)
  21: 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))})
  22: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)
  23: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))
  24: FUN(X[[i]], ...)
  25: lapply(seq_len(cores), inner.do)
  26: mclapply(chunks, predict_amps_core, df, model, min_len, mc.cores = n_cores)
  27: predict_amps(test_df, n_cores = 2)
  28: eval(code, test_env)
  29: eval(code, test_env)
  30: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
  31: doTryCatch(return(expr), name, parentenv, handler)
  32: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  33: tryCatchList(expr, classes, parentenv, handlers)
  34: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  35: doWithOneRestart(return(expr), restart)
  36: withOneRestart(expr, restarts[[1L]])
  37: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  38: test_code(code, parent.frame())
  39: test_that("predict_amps works with multiple cores", {    skip_on_os("windows")    test_df <- readRDS("../testdata/xbench.rds")    result_1core <- predict_amps(test_df, n_cores = 1)    expect_equal(dim(result_1core), c(16, 3))    result_2core <- predict_amps(test_df, n_cores = 2)    expect_equal(result_1core, result_2core)})
  40: eval(code, test_env)
  41: eval(code, test_env)
  42: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
  43: doTryCatch(return(expr), name, parentenv, handler)
  44: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  45: tryCatchList(expr, classes, parentenv, handlers)
  46: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  47: doWithOneRestart(return(expr), restart)
  48: withOneRestart(expr, restarts[[1L]])
  49: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  50: test_code(code = exprs, env = env, reporter = get_reporter() %||%     StopReporter$new())
  51: source_file(path, env = env(env), desc = desc, shuffle = shuffle,     error_call = error_call)
  52: FUN(X[[i]], ...)
  53: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle,     error_call = error_call)
  54: doTryCatch(return(expr), name, parentenv, handler)
  55: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  56: tryCatchList(expr, classes, parentenv, handlers)
  57: tryCatch(code, testthat_abort_reporter = function(cnd) {    cat(conditionMessage(cnd), "\n")    NULL})
  58: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, desc = desc, shuffle = shuffle, error_call = error_call))
  59: 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, shuffle = shuffle,     error_call = error_call)
  60: 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, shuffle = shuffle)
  61: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  62: test_check("ampir")
  An irrecoverable exception occurred. R is aborting now ...
  Saving _problems/test-predict-amps-199.R
  [ FAIL 1 | WARN 1 | SKIP 0 | PASS 82 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-predict-amps.R:197:3'): predict_amps works with multiple cores ──
  Expected `result_1core` to equal `result_2core`.
  Differences:
  `actual` is length 3
  `expected` is length 2
  
  `names(actual)`:   "seq_name" "seq_aa" "prob_AMP"
  `names(expected)`: "seq_name" "seq_aa"           
  
  `actual$prob_AMP` is a double vector (0.0237263013580434, 0.0302258304066241, 0.0433991662785352, 0.0393783553576832, 0.618460240944596, ...)
  `expected$prob_AMP` is absent
  
  
  [ FAIL 1 | WARN 1 | SKIP 0 | PASS 82 ]
  Error:
  ! Test failures.
  Execution halted