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

Addressed flaky Travis parallel test execution by adding a retry #287

Merged
merged 5 commits into from
Jan 11, 2017

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Nov 16, 2016

Fixes #143

@ssbarnea ssbarnea changed the title Feature/travis [wip] travis Nov 16, 2016
@ssbarnea ssbarnea force-pushed the feature/travis branch 2 times, most recently from 8835dbe to 0ee1974 Compare November 17, 2016 00:40
@@ -1692,9 +1694,9 @@ def test_create_version(self):

def test_create_version_with_project_obj(self):
project = self.jira.project(self.project_b)
version = self.jira.create_version('new version 1', project,
version = self.jira.create_version('new version 2', project,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we running tests in parallel?! (If so, where is this configured?)

Specifically, I know we run multiple Travis builds concurrently, but within a single Travis build (or local test run, for that matter) do multiple tests run in parallel?

This change, and the setup of the JiraTestManager imply that we do, but I can't see any evidence of this in the configuration or Travis test run logs, so I'm a bit confused.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asqui Yes, Travis is running 3 test executions in parallel, one for each python version 27,34,37 but tests are run sequentially for each of them. That's a good thing, when it works and instead of going the dirty way of running them sequentially we should do the right thing and fix them.

Also running tests in parallel will allow us to discover some real world scenarios that may not happen on a empty jira instance that is used exclusively for the purpose of one test. Is not quite a load test but if JIRA does not have atomic operations we should know it and adapt the library to make it more resilient to the server misbehaviours.

Based on the execution history I am inclined to believe that Jira is misbehaving and that is caching some results: example you may get a 5xx or 4xx error trying to create a resource (like a group or user) that was recently removed. By putting a sleep() or 1-2 seconds we may workaround this but I am not 100% sure yet as is very hard to get confirmation due to the flaky nature of the tests.

Still, I observed that these errors do not happen randomly over all the tests, when they happen they usually happen inside specific ones.

@asqui It would be great if you can have a look as this is the most important issue with the library, one that is preventing us from starting to release often and to provide bug fixes. Feel free to use the feature/travis branch to test other changes.

If you want to simulate what happens with Travis but on your own machine you could try to run detox which is mainly running tox in parallel.

The entire idea is that we should support running tests in parallel and that's why we generate the TestManager.jid unique id, which is supposed to be unique per execution: we should never have two test executions that run in parallel that are using the same jid.

Again, I am talking about parallelism regarding the whole execution of the test suites, not tests themselves, these are sequential and even the order is important.

@ssbarnea ssbarnea added the Status: In progress Currently being worked on. label Nov 17, 2016
@ssbarnea ssbarnea added this to the 1.0.8 milestone Nov 17, 2016
@vkrizan
Copy link

vkrizan commented Jan 8, 2017

I would suggest using random keys/names for test projects and issues. That should ensure that the next or parallel test will not fail. WDYT?

ssbarnea and others added 4 commits January 9, 2017 21:18
Change-Id: I016f823097c4edc89d8f0711fce9e4ae3fde6654
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Change-Id: I5cfec378205eda2f30697588f6833689724b6acf
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Change-Id: I63267bdc817319e8da02f6f4a1952db0cd9587b6
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Change-Id: Ia376514bc7d3e1478ae277568b60b0185464b58d
@ssbarnea ssbarnea force-pushed the feature/travis branch 15 times, most recently from 864a03e to 741f6ac Compare January 11, 2017 11:28
@ssbarnea ssbarnea force-pushed the feature/travis branch 8 times, most recently from 509d1e1 to 96184fb Compare January 11, 2017 22:59
…anism.

Change-Id: I8affe5ab3f9cfa8946cfdc9f969e338fbb43302b
@ssbarnea ssbarnea changed the title [wip] travis Addressed flaky Travis parallel test execution by adding a retry Jan 11, 2017
@ssbarnea ssbarnea merged commit 6fddfd1 into develop Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In progress Currently being worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants