Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DistributedRunner hangs when not calling XUnit.runtests #20

Open
maleadt opened this issue Jun 30, 2023 · 0 comments
Open

DistributedRunner hangs when not calling XUnit.runtests #20

maleadt opened this issue Jun 30, 2023 · 0 comments

Comments

@maleadt
Copy link
Contributor

maleadt commented Jun 30, 2023

MWE:

runtests.jl

using XUnit, Distributed

# add workers
exeflags = Base.julia_cmd()
push!(exeflags.exec, "--startup-file=no")
push!(exeflags.exec, "--project=$(Base.active_project())")
exename = popfirst!(exeflags.exec)
withenv("JULIA_NUM_THREADS" => 1, "OPENBLAS_NUM_THREADS" => 1) do
    addprocs(2; exename, exeflags)
end

@everywhere @testset runner=DistributedTestRunner() "WIP" begin
    @testcase "test1" begin
        @test true
    end

    @testcase "test2" begin
        @test true
    end

    @testcase "test3" begin
        @test true
    end

    @testcase "test4" begin
        @test true
    end
end

Instead using the following pattern works:

runtests.jl

using XUnit, Distributed

# add workers
exeflags = Base.julia_cmd()
push!(exeflags.exec, "--startup-file=no")
push!(exeflags.exec, "--project=$(Base.active_project())")
exename = popfirst!(exeflags.exec)
withenv("JULIA_NUM_THREADS" => 1, "OPENBLAS_NUM_THREADS" => 1) do
    addprocs(2; exename, exeflags)
end

@everywhere using XUnit
runtests("tests.jl")

tests.jl

using XUnit

@testset runner=DistributedTestRunner() "WIP" begin
    @testcase "test1" begin
        @test true
    end

    @testcase "test2" begin
        @test true
    end

    @testcase "test3" begin
        @test true
    end

    @testcase "test4" begin
        @test true
    end
end

I guess XUnit.runtests sets up some required state, but it's not clear to me whether that is intended? The README doesn't even mention XUnit.runtests...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant