Skip to content

Commit

Permalink
Merge pull request #1811 from josenavas/fix-test-error-race-condition
Browse files Browse the repository at this point in the history
Fixing failing test due to a race condition
  • Loading branch information
antgonza committed Apr 26, 2016
2 parents 83d4ce9 + 2c561a0 commit 339815f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qiita_pet/handlers/study_handlers/tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ def test_delete_artifact(self):
response = self.post('/artifact/',
{'artifact_id': 2})
self.assertEqual(response.code, 200)
# This is needed so the clean up works - this is a distributed system
# so we need to make sure that all processes are done before we reset
# the test database
obs = r_client.get('prep_template_1')
self.assertIsNotNone(obs)
redis_info = loads(r_client.get(loads(obs)['job_id']))
while redis_info['status_msg'] == 'Running':
sleep(0.05)
redis_info = loads(r_client.get(loads(obs)['job_id']))


class ArtifactAdminAJAXTestsReadOnly(TestHandlerBase):
Expand Down

0 comments on commit 339815f

Please sign in to comment.