Skip to content

Commit 2f94e1d

Browse files
committed
Fix timing issue with random seed test on windows
1 parent 2689dd3 commit 2f94e1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

inst/tests/test-utils.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ test_that("Setting process-wide seed doesn't affect private randomness", {
2121
test_that("Resetting private seed doesn't result in dupes", {
2222
.globals$ownSeed <- NULL
2323
id3 <- createUniqueId(4)
24+
# Make sure we let enough time pass that reinitializing the seed is
25+
# going to result in a different value. This is especially required
26+
# on Windows.
27+
Sys.sleep(1)
2428
set.seed(0)
2529
.globals$ownSeed <- NULL
2630
id4 <- createUniqueId(4)

0 commit comments

Comments
 (0)