File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -363,15 +363,26 @@ temp_pkg_dir() do project_path
363363 @test any (x -> startswith (x, manifest), keys (usage))
364364 end
365365
366- @testset " atomic write_env_usage with $(Sys. CPU_THREADS) processes for 10 seconds " begin
366+ @testset " test atomicity of write_env_usage with $(Sys. CPU_THREADS) parallel processes " begin
367367 tasks = Task[]
368368 iobs = IOBuffer[]
369369 Sys. CPU_THREADS == 1 && error (" Cannot test for atomic usage log file interaction effectively with only Sys.CPU_THREADS=1" )
370370 run (` $(Base. julia_cmd ()) --project="$(pkgdir (Pkg)) " -e "import Pkg"` ) # to precompile Pkg given we're in a different depot
371371 for i in 1 : Sys. CPU_THREADS
372372 iob = IOBuffer ()
373373 t = @async run (pipeline (` $(Base. julia_cmd ()) --project="$(pkgdir (Pkg)) "
374- -e "import Pkg; for i in 1:50 Pkg.activate(temp = true); Pkg.add(\" Random\" , io = devnull); Pkg.Types.EnvCache(); end"` ,
374+ -e "import Pkg;
375+ Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true;
376+ Pkg.activate(temp = true);
377+ Pkg.add(\" Random\" , io = devnull);
378+ for i in 1:100
379+ try
380+ Pkg.Types.EnvCache()
381+ catch
382+ println(stderr, \" Errored after $i iterations\" )
383+ rethrow()
384+ end
385+ end"` ,
375386 stderr = iob, stdout = devnull ))
376387 push! (tasks, t)
377388 push! (iobs, iob)
You can’t perform that action at this time.
0 commit comments