Unreliable redirect test
Liquidsoul opened this issue · 2 comments
Liquidsoul commented
New Issue Checklist
- I have tried with the latest version of OHHTTPStubs
- I have read the README
- I have read the Using the right Swift Version of
OHHTTPStubs
for your project section - I have searched in the existing issues
- I have read the OHHTTPStubs wiki to see if there wasn't a detailed page talking about my issue
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.
Liquidsoul commented
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
AliSoftware commented
😢
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.