From d14ea0898e7a8cfd618f78cd5177dd5e0298c090 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Thu, 3 Jun 2021 16:41:17 +0200 Subject: [PATCH] fix some RNG handling after new default RNG in Julia --- src/testset.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/testset.jl b/src/testset.jl index f52cd49..53c1786 100644 --- a/src/testset.jl +++ b/src/testset.jl @@ -495,7 +495,11 @@ function testset_beginend(mod::String, isfinal::Bool, pat::Pattern, id::Int64, d local oldrng = copy(RNG) try # RNG is re-seeded with its own seed to ease reproduce a failed test - Random.seed!(RNG.seed) + if VERSION >= v"1.7.0-DEV.1225" + Random.seed!(Random.GLOBAL_SEED) + else + Random.seed!(RNG.seed) + end let ts.timed = @stats $stats $(esc(tests)) end @@ -567,7 +571,11 @@ function testset_forloop(mod::String, isfinal::Bool, pat::Pattern, id::Int64, local ts local RNG = default_rng() local oldrng = copy(RNG) - Random.seed!(RNG.seed) + if VERSION >= v"1.7.0-DEV.1225" + Random.seed!(Random.GLOBAL_SEED) + else + Random.seed!(RNG.seed) + end local tmprng = copy(RNG) try let