Skip to content

Commit 3c5fe86

Browse files
committed
test: expect_rush_reset changes related to rush developments
1 parent 101098e commit 3c5fe86

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

tests/testthat/helper.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,17 @@ expect_acqfunction = function(acqf) {
220220
}
221221

222222
expect_rush_reset = function(rush, type = "kill") {
223-
processes = rush$processes
223+
processes = if (exists("processes", rush)) {
224+
rush$processes
225+
} else {
226+
rush$processes_processx %??% rush$processes_mirai
227+
}
224228
rush$reset(type = type)
225-
expect_list(rush$connector$command(c("KEYS", "*")), len = 0)
229+
Sys.sleep(1L)
230+
keys = rush$connector$command(c("KEYS", "*"))
231+
if (!test_list(keys, len = 0)) {
232+
stopf("Found keys in redis after reset: %s", keys)
233+
}
226234
walk(processes, function(p) p$kill())
227235
}
228236

tests/testthat/test_OptimizerAsyncMbo.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ test_that("OptimizerAsyncMbo works with evaluations in archive", {
3838
instance$terminator$param_set$values$n_evals = 40L
3939

4040
optimizer = opt("async_mbo")
41+
optimizer$optimize(instance)
4142

42-
expect_data_table(optimizer$optimize(instance), nrows = 1L)
4343
expect_data_table(instance$archive$data[is.na(get("acq_cb"))], min.rows = 10L)
4444
expect_data_table(instance$archive$data[!is.na(get("acq_cb"))], min.rows = 20L)
4545

0 commit comments

Comments
 (0)