diff --git a/Frameworks/Account/AccountTests/Feedly/FeedlyOperationTests.swift b/Frameworks/Account/AccountTests/Feedly/FeedlyOperationTests.swift index dc880597d..12992d748 100644 --- a/Frameworks/Account/AccountTests/Feedly/FeedlyOperationTests.swift +++ b/Frameworks/Account/AccountTests/Feedly/FeedlyOperationTests.swift @@ -102,6 +102,7 @@ class FeedlyOperationTests: XCTestCase { func testOperationCancellationFlags() { let testOperation = TestOperation() testOperation.didCallMainExpectation = expectation(description: "Did Call Main") + testOperation.didCallMainExpectation?.isInverted = true let completionExpectation = expectation(description: "Operation Completed") testOperation.completionBlock = { diff --git a/Frameworks/Account/AccountTests/Feedly/FeedlySyncAllOperationTests.swift b/Frameworks/Account/AccountTests/Feedly/FeedlySyncAllOperationTests.swift index cd1a988d3..5c7869439 100644 --- a/Frameworks/Account/AccountTests/Feedly/FeedlySyncAllOperationTests.swift +++ b/Frameworks/Account/AccountTests/Feedly/FeedlySyncAllOperationTests.swift @@ -67,11 +67,13 @@ class FeedlySyncAllOperationTests: XCTestCase { } let syncCompletionExpectation = expectation(description: "Did Finish Sync") + syncCompletionExpectation.isInverted = true syncAll.syncCompletionHandler = { result in switch result { case .success: - XCTFail("Expected failure.") + XCTFail("Sync operation was cancelled, not successful.") case .failure: + XCTFail("Sync operation should cancel silently.") break } syncCompletionExpectation.fulfill() diff --git a/Frameworks/Account/Feedly/Operations/FeedlySyncAllOperation.swift b/Frameworks/Account/Feedly/Operations/FeedlySyncAllOperation.swift index b93031677..ff6a1df96 100644 --- a/Frameworks/Account/Feedly/Operations/FeedlySyncAllOperation.swift +++ b/Frameworks/Account/Feedly/Operations/FeedlySyncAllOperation.swift @@ -97,6 +97,9 @@ final class FeedlySyncAllOperation: FeedlyOperation { super.cancel() didFinish() + + // Operation should silently cancel. + syncCompletionHandler = nil } override func main() {