Skip to content

Commit

Permalink
Swift 6 concurrency fixes (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler authored Jun 20, 2024
1 parent c1ff423 commit c7d0a6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion Sources/PerformanceTest/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ let port = Environment.shared.get("SERVER_PORT", as: Int.self) ?? 8080

// create app
let elg = MultiThreadedEventLoopGroup(numberOfThreads: 4)
defer { try? elg.syncShutdownGracefully() }
var router = Router()
// number of raw requests
// ./wrk -c 128 -d 15s -t 8 http://localhost:8080
Expand Down
11 changes: 9 additions & 2 deletions Tests/HummingbirdCoreTests/HTTP2Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ class HummingBirdHTTP2Tests: XCTestCase {
eventLoopGroupProvider: .shared(eventLoopGroup),
configuration: .init(tlsConfiguration: tlsConfiguration)
)
defer { try? httpClient.syncShutdown() }

let response = try await httpClient.get(url: "https://localhost:\(port)/").get()
let response: HTTPClientResponse
do {
let request = HTTPClientRequest(url: "https://localhost:\(port)/")
response = try await httpClient.execute(request, deadline: .now() + .seconds(30))
} catch {
try? await httpClient.shutdown()
throw error
}
try await httpClient.shutdown()
XCTAssertEqual(response.status, .ok)
}
}
Expand Down

0 comments on commit c7d0a6f

Please sign in to comment.