@@ -220,7 +220,7 @@ final class RequestBagTests: XCTestCase{
220220XCTAssert ( bag. eventLoop === embeddedEventLoop)
221221
222222let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
223- bag. cancel ( )
223+ bag. fail ( HTTPClientError . cancelled )
224224
225225 bag. willExecuteRequest ( executor)
226226XCTAssertTrue ( executor. isCancelled, " The request bag, should call cancel immediately on the executor " )
@@ -301,7 +301,7 @@ final class RequestBagTests: XCTestCase{
301301 bag. fail ( MyError ( ) )
302302XCTAssertEqual ( delegate. hitDidReceiveError, 1 )
303303
304- bag. cancel ( )
304+ bag. fail ( HTTPClientError . cancelled )
305305XCTAssertEqual ( delegate. hitDidReceiveError, 1 )
306306
307307XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -342,7 +342,7 @@ final class RequestBagTests: XCTestCase{
342342XCTAssertEqual ( delegate. hitDidSendRequestHead, 1 )
343343XCTAssertEqual ( delegate. hitDidSendRequest, 1 )
344344
345- bag. cancel ( )
345+ bag. fail ( HTTPClientError . cancelled )
346346XCTAssertTrue ( executor. isCancelled, " The request bag, should call cancel immediately on the executor " )
347347
348348XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -376,7 +376,7 @@ final class RequestBagTests: XCTestCase{
376376 bag. requestWasQueued ( queuer)
377377
378378XCTAssertEqual ( queuer. hitCancelCount, 0 )
379- bag. cancel ( )
379+ bag. fail ( HTTPClientError . cancelled )
380380XCTAssertEqual ( queuer. hitCancelCount, 1 )
381381
382382XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -445,9 +445,9 @@ final class RequestBagTests: XCTestCase{
445445let 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
453453XCTAssertEqual ( executor. isCancelled, true )
0 commit comments