@@ -220,7 +220,7 @@ final class RequestBagTests: XCTestCase {
220220 XCTAssert ( bag. eventLoop === embeddedEventLoop)
221221
222222 let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
223- bag. cancel ( )
223+ bag. fail ( HTTPClientError . cancelled )
224224
225225 bag. willExecuteRequest ( executor)
226226 XCTAssertTrue ( executor. isCancelled, " The request bag, should call cancel immediately on the executor " )
@@ -301,7 +301,7 @@ final class RequestBagTests: XCTestCase {
301301 bag. fail ( MyError ( ) )
302302 XCTAssertEqual ( delegate. hitDidReceiveError, 1 )
303303
304- bag. cancel ( )
304+ bag. fail ( HTTPClientError . cancelled )
305305 XCTAssertEqual ( delegate. hitDidReceiveError, 1 )
306306
307307 XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -342,7 +342,7 @@ final class RequestBagTests: XCTestCase {
342342 XCTAssertEqual ( delegate. hitDidSendRequestHead, 1 )
343343 XCTAssertEqual ( delegate. hitDidSendRequest, 1 )
344344
345- bag. cancel ( )
345+ bag. fail ( HTTPClientError . cancelled )
346346 XCTAssertTrue ( executor. isCancelled, " The request bag, should call cancel immediately on the executor " )
347347
348348 XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -376,7 +376,7 @@ final class RequestBagTests: XCTestCase {
376376 bag. requestWasQueued ( queuer)
377377
378378 XCTAssertEqual ( queuer. hitCancelCount, 0 )
379- bag. cancel ( )
379+ bag. fail ( HTTPClientError . cancelled )
380380 XCTAssertEqual ( queuer. hitCancelCount, 1 )
381381
382382 XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -445,9 +445,9 @@ final class RequestBagTests: XCTestCase {
445445 let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
446446 executor. runRequest ( bag)
447447
448- // This simulates a race between the user cancelling the task (which invokes `RequestBag.cancel `) and the
448+ // This simulates a race between the user cancelling the task (which invokes `RequestBag.fail(_:) `) and the
449449 // call to `resumeRequestBodyStream` (which comes from the `Channel` event loop and so may have to hop.
450- bag. cancel ( )
450+ bag. fail ( HTTPClientError . cancelled )
451451 bag. resumeRequestBodyStream ( )
452452
453453 XCTAssertEqual ( executor. isCancelled, true )
0 commit comments