Skip to content

Commit 8b5b390

Browse files
committed
Tests: clean up subprocess
1 parent 53d39c0 commit 8b5b390

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/testthat/test.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ test_that("clean up file descriptor on interrupt", {
342342
tmp <- tempfile()
343343
l <- filelock::lock(tmp)
344344
rs <- callr::r_session$new()
345+
on.exit(rs$close(), add = TRUE)
345346
rs$call(
346347
function(path) .GlobalEnv$lock <- filelock::lock(path),
347348
list(tmp)
@@ -372,6 +373,7 @@ test_that("clean up file descriptor on timeout", {
372373
tmp <- tempfile()
373374
l <- filelock::lock(tmp)
374375
rs <- callr::r_session$new()
376+
on.exit(rs$close(), add = TRUE)
375377
rs$call(
376378
function(path) .GlobalEnv$lock <- filelock::lock(path, timeout = 10),
377379
list(tmp)

0 commit comments

Comments
 (0)