Skip to content

Commit 6002648

Browse files
committed
make sure the sub-process exits
1 parent 355dddb commit 6002648

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tests/testthat/test-subprocess.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test_that("a subprocess can be spawned and killed", {
1717
expect_true(process_exists(handle))
1818

1919
process_kill(handle)
20-
process_wait(handle, 1000)
20+
expect_equal(process_poll(handle, TIMEOUT_INFINITE), "terminated")
2121
expect_false(process_exists(handle))
2222
})
2323

tests/testthat/test-termination.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ test_that("child process is terminated in Windows", {
3535

3636
# ... and not after we kill the parent
3737
process_kill(parent_handle)
38+
expect_equal(process_poll(parent_handle, TIMEOUT_INFINITE), "terminated")
3839
expect_false(process_exists(parent_handle))
3940
expect_false(process_exists(child_id))
4041
})
@@ -75,6 +76,7 @@ test_that("child process is terminated in Linux", {
7576

7677
# ... and not after we kill the parent
7778
process_kill(parent_handle)
79+
expect_equal(process_poll(parent_handle, TIMEOUT_INFINITE), "terminated")
7880
expect_false(process_exists(parent_handle))
7981
expect_false(process_exists(child_id))
8082
})

0 commit comments

Comments
 (0)