From 853b1f38959f0bb8135486454c8e457116d37e4d Mon Sep 17 00:00:00 2001 From: tan Date: Fri, 15 Mar 2024 07:54:22 +0530 Subject: [PATCH] fix(ci): fix test code that caused ci freeze Fixes an issue in the test code that used a closed channel unintentionally. --- .../openapigenerator_petstore_v3/petstore_test_storeapi.jl | 3 +++ test/client/petstore_v2/petstore_test_storeapi.jl | 3 +++ test/client/petstore_v3/petstore_test_storeapi.jl | 3 +++ test/client/runtests.jl | 4 ++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl b/test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl index d3f2e1e..15991b6 100644 --- a/test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl +++ b/test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl @@ -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) diff --git a/test/client/petstore_v2/petstore_test_storeapi.jl b/test/client/petstore_v2/petstore_test_storeapi.jl index 5df5edf..fc07ef5 100644 --- a/test/client/petstore_v2/petstore_test_storeapi.jl +++ b/test/client/petstore_v2/petstore_test_storeapi.jl @@ -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) diff --git a/test/client/petstore_v3/petstore_test_storeapi.jl b/test/client/petstore_v3/petstore_test_storeapi.jl index 715b465..1aa7beb 100644 --- a/test/client/petstore_v3/petstore_test_storeapi.jl +++ b/test/client/petstore_v3/petstore_test_storeapi.jl @@ -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) diff --git a/test/client/runtests.jl b/test/client/runtests.jl index 82c2959..af4a380 100644 --- a/test/client/runtests.jl +++ b/test/client/runtests.jl @@ -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)")