Skip to content

Commit 48a9fff

Browse files
authored
fix(ci): fix test code that caused ci freeze (#69)
Fixes an issue in the test code that used a closed channel unintentionally.
1 parent 1916168 commit 48a9fff

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ function test(uri)
5353
# a closed channel is equivalent of cancellation of the call,
5454
# no error should be thrown, but response can be nothing if call was interrupted immediately
5555
@test !isopen(response_channel)
56+
57+
# open a new channel to use
58+
response_channel = Channel{Order}(1)
5659
try
5760
resp, http_resp = get_order_by_id(api, response_channel, Int64(5))
5861
@test (200 <= http_resp.status <= 206)

test/client/petstore_v2/petstore_test_storeapi.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ function test(uri)
5353
# a closed channel is equivalent of cancellation of the call,
5454
# no error should be thrown, but response can be nothing if call was interrupted immediately
5555
@test !isopen(response_channel)
56+
57+
# open a new channel to use
58+
response_channel = Channel{Order}(1)
5659
try
5760
resp, http_resp = get_order_by_id(api, response_channel, Int64(5))
5861
@test (200 <= http_resp.status <= 206)

test/client/petstore_v3/petstore_test_storeapi.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ function test(uri)
5353
# a closed channel is equivalent of cancellation of the call,
5454
# no error should be thrown, but response can be nothing if call was interrupted immediately
5555
@test !isopen(response_channel)
56+
57+
# open a new channel to use
58+
response_channel = Channel{Order}(1)
5659
try
5760
resp, http_resp = get_order_by_id(api, response_channel, Int64(5))
5861
@test (200 <= http_resp.status <= 206)

test/client/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ function runtests(; skip_petstore=false, test_file_upload=false)
3030
PetStoreV3Tests.runtests(; test_file_upload=test_file_upload)
3131
end
3232
@testset "V2" begin
33-
@info("Running petstore v2 tests")
34-
PetStoreV2Tests.runtests()
33+
@info("Running petstore v2 tests")
34+
PetStoreV2Tests.runtests()
3535
end
3636
else
3737
@info("Skipping petstore tests in non Linux environment (can not run petstore docker on OSX or Windows)")

0 commit comments

Comments
 (0)