Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Don't call done unless the test case passes #339

Merged
merged 1 commit into from
Oct 19, 2016

Conversation

davisjam
Copy link
Contributor

Problem:
In test case:
'Reuse authentication tokens'
-> 'When a PEP Proxy has an expired token and another
request arrives to the proxy'
-> 'both requests should finish'

We call done() without being sure that both requests have finished.

Solution:
Only call done once the second request receives a response.
When the test case fails, it now does so in the test case proper
rather than in the afterEach hook.

Problem:
Test case 'Reuse authentication tokens'
            -> 'When a PEP Proxy has an expired token and another
                request arrives to the proxy'
               -> 'both requests should finish'

We call done() without being sure that both requests have finished.

Solution:
Only call done once the second request receives a response.
When the test case fails, it now does so in the test case proper
rather than in a hook.
@davisjam
Copy link
Contributor Author

The "once response is received" callbacks are identical. Perhaps we should extract that functionality into a separate function.

@dmoranj
Copy link
Contributor

dmoranj commented Oct 19, 2016

LGTM. Concerning the duplicated code, you can add a technical debt issue in the issues list, and we will try to clean it once we have a slot to reduce techdebt.

Thanks for your contribution.

@dmoranj dmoranj merged commit 53843ac into telefonicaid:master Oct 19, 2016
@davisjam
Copy link
Contributor Author

Added issue #341.

@davisjam davisjam deleted the honest_done branch October 19, 2016 14:14
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.

2 participants