Skip to content

Commit

Permalink
fix(ci): fix test code that caused ci freeze (#69)
Browse files Browse the repository at this point in the history
Fixes an issue in the test code that used a closed channel unintentionally.
  • Loading branch information
tanmaykm authored Mar 15, 2024
1 parent 1916168 commit 48a9fff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function test(uri)
# a closed channel is equivalent of cancellation of the call,
# no error should be thrown, but response can be nothing if call was interrupted immediately
@test !isopen(response_channel)

# open a new channel to use
response_channel = Channel{Order}(1)
try
resp, http_resp = get_order_by_id(api, response_channel, Int64(5))
@test (200 <= http_resp.status <= 206)
Expand Down
3 changes: 3 additions & 0 deletions test/client/petstore_v2/petstore_test_storeapi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function test(uri)
# a closed channel is equivalent of cancellation of the call,
# no error should be thrown, but response can be nothing if call was interrupted immediately
@test !isopen(response_channel)

# open a new channel to use
response_channel = Channel{Order}(1)
try
resp, http_resp = get_order_by_id(api, response_channel, Int64(5))
@test (200 <= http_resp.status <= 206)
Expand Down
3 changes: 3 additions & 0 deletions test/client/petstore_v3/petstore_test_storeapi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function test(uri)
# a closed channel is equivalent of cancellation of the call,
# no error should be thrown, but response can be nothing if call was interrupted immediately
@test !isopen(response_channel)

# open a new channel to use
response_channel = Channel{Order}(1)
try
resp, http_resp = get_order_by_id(api, response_channel, Int64(5))
@test (200 <= http_resp.status <= 206)
Expand Down
4 changes: 2 additions & 2 deletions test/client/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ function runtests(; skip_petstore=false, test_file_upload=false)
PetStoreV3Tests.runtests(; test_file_upload=test_file_upload)
end
@testset "V2" begin
@info("Running petstore v2 tests")
PetStoreV2Tests.runtests()
@info("Running petstore v2 tests")
PetStoreV2Tests.runtests()
end
else
@info("Skipping petstore tests in non Linux environment (can not run petstore docker on OSX or Windows)")
Expand Down

0 comments on commit 48a9fff

Please sign in to comment.