@@ -220,7 +220,7 @@ final class RequestBagTests: XCTestCase {
220
220
XCTAssert ( bag. eventLoop === embeddedEventLoop)
221
221
222
222
let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
223
- bag. cancel ( )
223
+ bag. fail ( HTTPClientError . cancelled )
224
224
225
225
bag. willExecuteRequest ( executor)
226
226
XCTAssertTrue ( executor. isCancelled, " The request bag, should call cancel immediately on the executor " )
@@ -301,7 +301,7 @@ final class RequestBagTests: XCTestCase {
301
301
bag. fail ( MyError ( ) )
302
302
XCTAssertEqual ( delegate. hitDidReceiveError, 1 )
303
303
304
- bag. cancel ( )
304
+ bag. fail ( HTTPClientError . cancelled )
305
305
XCTAssertEqual ( delegate. hitDidReceiveError, 1 )
306
306
307
307
XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -342,7 +342,7 @@ final class RequestBagTests: XCTestCase {
342
342
XCTAssertEqual ( delegate. hitDidSendRequestHead, 1 )
343
343
XCTAssertEqual ( delegate. hitDidSendRequest, 1 )
344
344
345
- bag. cancel ( )
345
+ bag. fail ( HTTPClientError . cancelled )
346
346
XCTAssertTrue ( executor. isCancelled, " The request bag, should call cancel immediately on the executor " )
347
347
348
348
XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -376,7 +376,7 @@ final class RequestBagTests: XCTestCase {
376
376
bag. requestWasQueued ( queuer)
377
377
378
378
XCTAssertEqual ( queuer. hitCancelCount, 0 )
379
- bag. cancel ( )
379
+ bag. fail ( HTTPClientError . cancelled )
380
380
XCTAssertEqual ( queuer. hitCancelCount, 1 )
381
381
382
382
XCTAssertThrowsError ( try bag. task. futureResult. wait ( ) ) {
@@ -445,9 +445,9 @@ final class RequestBagTests: XCTestCase {
445
445
let executor = MockRequestExecutor ( eventLoop: embeddedEventLoop)
446
446
executor. runRequest ( bag)
447
447
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
449
449
// call to `resumeRequestBodyStream` (which comes from the `Channel` event loop and so may have to hop.
450
- bag. cancel ( )
450
+ bag. fail ( HTTPClientError . cancelled )
451
451
bag. resumeRequestBodyStream ( )
452
452
453
453
XCTAssertEqual ( executor. isCancelled, true )
0 commit comments