Skip to content

Commit

Permalink
finalise tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed May 10, 2023
1 parent 11e8706 commit e40c2b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mirai
Type: Package
Title: Minimalist Async Evaluation Framework for R
Version: 0.8.4.9007
Version: 0.8.4.9009
Description: Lightweight parallel code execution and distributed computing.
Designed for simplicity, a 'mirai' evaluates an R expression asynchronously,
on local or network resources, resolving automatically upon completion.
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# mirai 0.8.4.9007
# mirai 0.8.4.9009

* `server()` and `dispatcher()` argument 'asyncdial' is now FALSE by default, causing these functions to exit if a connection is not immediately available. This means that for distributed computing purposes, `dameons()` should be called before `server()` is launched on remote resources, or else `server(asyncdial = TRUE)` allows servers to wait for a connection.
* `launch_server()` now parses the passed URL for correctness before attempting to launch a server, producing an error if not valid.
Expand Down
20 changes: 9 additions & 11 deletions tests/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,8 @@ args <- list(m = 2L, n = 4L)
m <- mirai(.expr = `lang obj`, .args = args, .timeout = 2000L)
nanotest(call_mirai(m)$data == 8L || is_error_value(m$data))
Sys.sleep(2.2)
m <- mirai(1)
Sys.sleep(2.2)
nanotest(daemons(url = value <- mirai:::auto_tokenized_url(), dispatcher = FALSE) == value)
nanotestz(daemons(0L))
Sys.sleep(0.5)
nanotest(daemons(n = 2L, url = value <- "ws://:0", dispatcher = FALSE) != value)
nanotestz(daemons(0L))
Sys.sleep(0.5)
nanotesto(daemons(url = "ws://:0", token = TRUE))
nanotestz(daemons(0L))
Sys.sleep(1L)
nanotesto(daemons(url = "tcp://:0", token = TRUE))
nanotestz(daemons(0L))
Sys.sleep(1L)
nanotesto(daemons(1L, dispatcher = FALSE, idletime = 500L, timerstart = 1L, cleanup = 0L, .compute = "new"))
Sys.sleep(2L)
Expand All @@ -90,6 +79,15 @@ nanotestz(daemons(0L, .compute = "new"))
Sys.sleep(1L)

if (.Platform[["OS.type"]] != "windows") {
nanotest(daemons(n = 2L, url = value <- "ws://:0", dispatcher = FALSE) != value)
nanotestz(daemons(0L))
Sys.sleep(0.5)
nanotesto(daemons(url = "ws://:0", token = TRUE))
nanotestz(daemons(0L))
Sys.sleep(1L)
nanotesto(daemons(url = "tcp://:0", token = TRUE))
nanotestz(daemons(0L))
Sys.sleep(1L)
nanotest(daemons(n = 2, "ws://:0") == 2L)
Sys.sleep(1L)
status <- daemons()[["daemons"]]
Expand Down

0 comments on commit e40c2b8

Please sign in to comment.