AliSoftware/OHHTTPStubs

Unreliable redirect test

Liquidsoul opened this issue · 2 comments

New Issue Checklist

Environment

  • version of OHHTTPStubs: master

Issue Description

Following the introduction of #263 the test - [NSURLSessionTests test_NSURLSessionDefaultConfig_MethodAndDataRetentionOnRedirect] fails most of the time (see @AliSoftware comment).
We need to investigate this issue so that we can have a reliable CI.

Ok, after some investigations this seems related to #230 (comment)

I have experienced the same issues (redirect data without response object) for the failures.
So this seems like a NSURLProtocol bug.

So now I see several options:

  • we find a workaround in the library to make this reliable (that seems unlikely to me)
  • we find a workaround for the tests, but this would mean that client code can fail, and this occurs a lot in the tests in my experience
  • we disable the tests and document that redirections are not correctly supported by OHHTTPStubs because of an Apple bug

😢

I think we'll have to go with solution 3 then. I think we could still keep the code handling the redirections, but just document properly that there are issues due to the Apple bug.