Skip to content

Commit

Permalink
Fail if handler isnt cancelled in testCancelOnCloseInbound
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Dec 12, 2024
1 parent fd83af7 commit c2bbca4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/HummingbirdCoreTests/CoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ final class HummingBirdCoreTests: XCTestCase {
var bodyWriter = try await responseWriter.writeHead(.init(status: .ok))
try await request.body.consumeWithCancellationOnInboundClose { body in
let body = try await body.collect(upTo: .max)
for _ in 0..<200 {
for _ in 0..<50 {
do {
try Task.checkCancellation()
try await Task.sleep(for: .seconds(1))
Expand All @@ -657,7 +657,7 @@ final class HummingBirdCoreTests: XCTestCase {
throw error
}
}
try await Task.sleep(for: .seconds(60))
XCTFail("Should not reach here as the handler should have been cancelled")
}
try await bodyWriter.finish(nil)
},
Expand Down

0 comments on commit c2bbca4

Please sign in to comment.