mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #337] Tests with OAuthSwift throwing retain error every once in a while #210
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#210
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jalopezmo on GitHub (Feb 16, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/337
Description:
OAuth Provider (Twitter, Github, ..):
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
8.0 (Swift 3.0)
8.0 (Swift 2.3)
7.3.1
other: (Please fill in the version you are using.)
objective c
I had to install the framework manually because I had to edit some things in order to comply with server requirements. But I have been having some issues. Specifically, what has been happening is that in most of my tests, the OAuth process is throwing a retain error. It is important to clarify that this doesn't happen when running the app, just when the tests run.
This is the class that does the OAuth process.
And this is a failing test:
@phimage commented on GitHub (Feb 17, 2017):
"I had to install the framework manually because I had to edit some things in order to comply with server requirements"
-> you can do it also with cocoapod using dev pod
you can have also your fork on github -> so I can see the difference
To show me a bug, it's a very very good choice to make an unit test, but you could also commit it, so I have just to download your fork and test it
Here there is too much specific code that I cannot test (User, OAuth.URLParameters,...)
then your oauth workflow is a little different and maybe that's the point
I try to convert your code with a test server, and comment some part, but there is no issue for me
@jalopezmo commented on GitHub (Feb 17, 2017):
Hi, thank you for your answer.
I think I may have found the source of the bug, so you know. It seems that since the app and the tests are running at the same time, somehow the app is clearing the oauth instance the test was using. Causing the retain error, which is actually that the object was released while waiting for the local notification to arrive.
I have found a temporal fix, which is to comment the line that starts the OAuth flow in the app when running my tests.
@jalopezmo commented on GitHub (Feb 17, 2017):
Oh, and by the way, the only modification I had to do to your code was being able to change the timestamp you are using to sign the request.
@phimage commented on GitHub (Feb 17, 2017):
ok, so this is a true retain error, the object has been released
@jalopezmo commented on GitHub (Feb 17, 2017):
Yes, thank you for your help.