From e28d1b57fb612403a940dbcdcecb036a2b511bb5 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 24 Nov 2023 14:51:51 +0100 Subject: [PATCH] Make CI green again (#1128) * Fix tests for new version of `ConcurrentUtilities` `ConcurrentUtilities` changed an (internal) fieldname of the `Pool` type from `max` to `limit`. This field is used in HTTP.jl tests so this patch works around the issue. * Remove invalidation CI check This has been failing for quite some time with some internal error. Also in the working case it is a bit unclear what the actionable thing is when it errors (xref https://github.com/JuliaWeb/HTTP.jl/pull/920#issuecomment-1254284159). --- .github/workflows/Invalidations.yml | 40 ----------------------------- test/client.jl | 13 ++++++---- 2 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/Invalidations.yml diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml deleted file mode 100644 index 4d0004e83..000000000 --- a/.github/workflows/Invalidations.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Invalidations - -on: - pull_request: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: always. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - evaluate: - # Only run on PRs to the default branch. - # In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch - if: github.base_ref == github.event.repository.default_branch - runs-on: ubuntu-latest - steps: - - uses: julia-actions/setup-julia@v1 - with: - version: '1' - - uses: actions/checkout@v3 - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_pr - - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.repository.default_branch }} - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_default - - - name: Report invalidation counts - run: | - echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - - name: Check if the PR does increase number of invalidations - if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total - run: exit 1 diff --git a/test/client.jl b/test/client.jl index 868ac8ded..a706e3f43 100644 --- a/test/client.jl +++ b/test/client.jl @@ -13,12 +13,15 @@ using URIs using InteractiveUtils: @which using ConcurrentUtilities +# ConcurrentUtilities changed a fieldname from max to limit in 2.3.0 +const max_or_limit = :max in fieldnames(ConcurrentUtilities.Pool) ? (:max) : (:limit) + # test we can adjust default_connection_limit for x in (10, 12) HTTP.set_default_connection_limit!(x) - @test HTTP.Connections.TCP_POOL[].max == x - @test HTTP.Connections.MBEDTLS_POOL[].max == x - @test HTTP.Connections.OPENSSL_POOL[].max == x + @test getfield(HTTP.Connections.TCP_POOL[], max_or_limit) == x + @test getfield(HTTP.Connections.MBEDTLS_POOL[], max_or_limit) == x + @test getfield(HTTP.Connections.OPENSSL_POOL[], max_or_limit) == x end @testset "@client macro" begin @@ -325,11 +328,11 @@ end end @testset "connect_timeout does not include the time needed to acquire a connection from the pool" begin - connection_limit = HTTP.Connections.TCP_POOL[].max + connection_limit = getfield(HTTP.Connections.TCP_POOL[], max_or_limit) try dummy_conn = HTTP.Connection(Sockets.TCPSocket()) HTTP.set_default_connection_limit!(1) - @assert HTTP.Connections.TCP_POOL[].max == 1 + @assert getfield(HTTP.Connections.TCP_POOL[], max_or_limit) == 1 # drain the pool acquire(()->dummy_conn, HTTP.Connections.TCP_POOL[], HTTP.Connections.connectionkey(dummy_conn)) # Put it back in 10 seconds