Skip to content

Commit

Permalink
In a test suite this failure goes as "test__092__RestClient__request_…
Browse files Browse the repository at this point in the history
…_method_signature_and_arguments__should_do_a_request_and_receive_a_valid_response", i.e. the test which is being executed at the moment when fail("Completion closure should not be called") is called within "test__090__RestClient__..." test (https://github.com/ably/ably-cocoa/blob/ca4ffa1f582714945b9f323a1dc86b1da57c974f/Test/Tests/RestClientTests.swift#L1916).

Test passes frequently on CI because I assume tests failures after execution not always tracked by XCTest framework. Locally it crashes with this:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempted to report a test failure to XCTest while no test case was running. The failure was:
"Completion closure should not be called".

The path "new feature" is not an invalid path, since it's being replaced with "new%20feature" in Foundation. So I'm removing this check.

I've noticed that this test fails frequently when other well known set of tests (https://test-observability.herokuapp.com/repos/ably/ably-cocoa/uploads/554d09f1-71e2-4e79-b641-9f33a8382220) don't fail. So when I've fixed it in this experimental PR (#1799), it finally could pass (after a few attemts).
  • Loading branch information
maratal committed Nov 19, 2023
1 parent c73a6ea commit d8502e7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions Test/Tests/RestClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1911,15 +1911,6 @@ class RestClientTests: XCTestCase {
let mockHTTPExecutor = MockHTTPExecutor()
rest.internal.httpExecutor = mockHTTPExecutor

do {
try rest.request("get", path: "new feature", params: nil, body: nil, headers: nil) { _, _ in
fail("Completion closure should not be called")
}
} catch let error as NSError {
XCTAssertEqual(error.code, ARTCustomRequestError.invalidPath.rawValue)
expect(error.localizedDescription).to(contain("Path isn't valid"))
}

do {
try rest.request("get", path: "", params: nil, body: nil, headers: nil) { _, _ in
fail("Completion closure should not be called")
Expand Down

0 comments on commit d8502e7

Please sign in to comment.