Skip to content

Commit 8a614d5

Browse files
authored
Skip flakey "concurrent requests" tests on windows (#228)
1 parent 246504e commit 8a614d5

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

test/runtests.jl

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -379,25 +379,31 @@ include("setup.jl")
379379
end
380380

381381
@testset "concurrent requests" begin
382-
mine = Downloader()
383-
for downloader in (nothing, mine)
384-
have_lsof = Sys.which("lsof") !== nothing
385-
count_tcp() = Base.count(x->contains("TCP",x), split(read(`lsof -p $(getpid())`, String), '\n'))
386-
if have_lsof
387-
n_tcp = count_tcp()
388-
end
389-
delay = 2
390-
count = 100
391-
url = "$server/delay/$delay"
392-
t = @elapsed @sync for id = 1:count
393-
@async begin
394-
json = download_json("$url?id=$id", downloader = downloader)
395-
@test get(json["args"], "id", nothing) == ["$id"]
382+
if Sys.iswindows()
383+
# Known issue https://github.com/JuliaLang/Downloads.jl/issues/227
384+
# These test should be fixed on Windows and then reenabled.
385+
@test_skip "concurrent requests flakey on Windows"
386+
else
387+
mine = Downloader()
388+
for downloader in (nothing, mine)
389+
have_lsof = Sys.which("lsof") !== nothing
390+
count_tcp() = Base.count(x->contains("TCP",x), split(read(`lsof -p $(getpid())`, String), '\n'))
391+
if have_lsof
392+
n_tcp = count_tcp()
393+
end
394+
delay = 2
395+
count = 100
396+
url = "$server/delay/$delay"
397+
t = @elapsed @sync for id = 1:count
398+
@async begin
399+
json = download_json("$url?id=$id", downloader = downloader)
400+
@test get(json["args"], "id", nothing) == ["$id"]
401+
end
402+
end
403+
@test t < 0.9*count*delay
404+
if have_lsof
405+
@test n_tcp == count_tcp()
396406
end
397-
end
398-
@test t < 0.9*count*delay
399-
if have_lsof
400-
@test n_tcp == count_tcp()
401407
end
402408
end
403409
end

0 commit comments

Comments
 (0)