Skip to content

Early returning in -[LSHTTPStubURLProtocol startLoading] to prevent failures#154

Open
cristik wants to merge 1 commit intolausobo:masterfrom
cristik:cristik/prevent_failures_in_unrelated_tests
Open

Early returning in -[LSHTTPStubURLProtocol startLoading] to prevent failures#154
cristik wants to merge 1 commit intolausobo:masterfrom
cristik:cristik/prevent_failures_in_unrelated_tests

Conversation

@cristik
Copy link
Copy Markdown

@cristik cristik commented Nov 11, 2017

Since NSURLSession will execute the requests on a background thread, we can end up in the situation when the tearDown of a previous unit test stops Nocilla since it no longer needs it, and startLoading gets called while in the middle of another unrelated test case, thus causing an exception and failing the other test.

So, we're early returning from startLoading to prevent this kind of failures.

…ailures

Since `NSURLSession` will execute the requests on a background thread, we can end up in the situation when the `tearDown` of a previous unit test stops Nocilla since it no longer needs it, and `startLoading` gets called while in the middle of another unrelated test case, thus causing an exception and failing the other test.

So, we're early returning from `startLoading` to prevent this kind of failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant