diff --git a/test/runtests.jl b/test/runtests.jl index f50280e..76db9e8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -379,25 +379,31 @@ include("setup.jl") end @testset "concurrent requests" begin - mine = Downloader() - for downloader in (nothing, mine) - have_lsof = Sys.which("lsof") !== nothing - count_tcp() = Base.count(x->contains("TCP",x), split(read(`lsof -p $(getpid())`, String), '\n')) - if have_lsof - n_tcp = count_tcp() - end - delay = 2 - count = 100 - url = "$server/delay/$delay" - t = @elapsed @sync for id = 1:count - @async begin - json = download_json("$url?id=$id", downloader = downloader) - @test get(json["args"], "id", nothing) == ["$id"] + if Sys.iswindows() + # Known issue https://github.com/JuliaLang/Downloads.jl/issues/227 + # These test should be fixed on Windows and then reenabled. + @test_skip "concurrent requests flakey on Windows" + else + mine = Downloader() + for downloader in (nothing, mine) + have_lsof = Sys.which("lsof") !== nothing + count_tcp() = Base.count(x->contains("TCP",x), split(read(`lsof -p $(getpid())`, String), '\n')) + if have_lsof + n_tcp = count_tcp() + end + delay = 2 + count = 100 + url = "$server/delay/$delay" + t = @elapsed @sync for id = 1:count + @async begin + json = download_json("$url?id=$id", downloader = downloader) + @test get(json["args"], "id", nothing) == ["$id"] + end + end + @test t < 0.9*count*delay + if have_lsof + @test n_tcp == count_tcp() end - end - @test t < 0.9*count*delay - if have_lsof - @test n_tcp == count_tcp() end end end