ORCID / python-orcid

Python wrapper around ORCID API
BSD 3-Clause "New" or "Revised" License
92 stars 26 forks source link

tests: fix failing travis after adding xml support #22

Closed szymonlopaciuk closed 7 years ago

szymonlopaciuk commented 7 years ago

This aims to fix failing Travis tests after #21.

Changes

Motivation

One particular fail case, which caused all of the other failures, was an assertion failure after addition of a new record. The latter failures were conflicts (HTTP 409) due to test leakage, as clean-up code was not executed after the first failure, and tests were trying to add an already existing record to ORCID.

In the former case, despite the fact that the record addition request itself seemed to proceed with no errors, the API returned zero results when queried for the added record. This could be caused by some delays in refreshing, maybe the requests were being sent too quickly. This is made more probable by the fact that when ran on my personal branch, the tests were flaky, and when I retried them they passed (even though no changes to the code logic had been done at that point).

Adding three retries with delays before failing that test case may solve this issue, and it seems to have worked on my personal branch: https://travis-ci.org/szymonlopaciuk/python-orcid/builds/295723393.

MSusik commented 6 years ago

@szymonlopaciuk Great, thanks for the PR. Please let me know when you integrate 2.0 version in Invenio. If it is tested, we can push it to PyPI