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

Skip flakey "concurrent requests" tests on windows #228

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down