Skip to content

Commit 0ec8b6d

Browse files
committed
Add multi-process test
1 parent e6e927a commit 0ec8b6d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main, master]
5+
branches: [main, dev]
66
pull_request:
77

88
name: test-coverage.yaml

R/utils.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ ip_addr <- function() .Call(rnng_ip_addr)
415415
#'
416416
.interrupt <- function(x = TRUE) .Call(rnng_interrupt_switch, x)
417417

418+
.test <- function() {
419+
Sys.sleep(0.5)
420+
close(stream(dial = "ws://127.0.0.1:5555", textframes = TRUE))
421+
}
422+
418423
#' Internal Package Function
419424
#'
420425
#' Only present for cleaning up after running examples and tests. Do not attempt

tests/tests.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,12 @@ if (!interactive() && Sys.getenv("NOT_CRAN") == "true") {
653653
test_equal(collect_aio(r), 7L)
654654
}
655655

656+
if (Sys.getenv("NOT_CRAN") == "true") {
657+
system2(file.path(R.home("bin"), if (.Platform$OS.type == "unix") "Rscript" else "Rscript.exe"), args = c("-e", shQuote("nanonext:::.test()")), wait = FALSE)
658+
test_class("nanoStream", s <- stream(listen = "ws://127.0.0.1:5555", textframes = TRUE))
659+
test_zero(close(s))
660+
}
661+
656662
if (Sys.info()[["sysname"]] == "Linux") {
657663
rm(list = ls())
658664
invisible(gc())

0 commit comments

Comments
 (0)