Skip to content

Commit

Permalink
Make CI green again (#1128)
Browse files Browse the repository at this point in the history
* 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
#920 (comment)).
  • Loading branch information
fredrikekre authored Nov 24, 2023
1 parent 5cd586d commit e28d1b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 45 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/Invalidations.yml

This file was deleted.

13 changes: 8 additions & 5 deletions test/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e28d1b5

Please sign in to comment.