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

resource_status test fails without --reset-db #2072

Closed
davidread opened this issue Nov 20, 2014 · 0 comments
Closed

resource_status test fails without --reset-db #2072

davidread opened this issue Nov 20, 2014 · 0 comments
Assignees

Comments

@davidread
Copy link
Contributor

If you run this particular test twice then it fails the second and subsequent times:

nosetests --ckan --with-pylons=test-core.ini ckan/tests/logic/test_action.py:TestAction.test_40_task_resource_status
nosetests --ckan --with-pylons=test-core.ini ckan/tests/logic/test_action.py:TestAction.test_40_task_resource_status
IntegrityError: (IntegrityError) duplicate key value violates unique constraint "celery_taskmeta_pkey"
DETAIL:  Key (id)=(2) already exists.
 "INSERT INTO task_status (id, entity_id, entity_type, task_type, key, value, state, error, last_updated) VALUES ('5753adae-cd0d-4327-915d-edd832d1c9a3', '749cdcf2-3fc8-44ae-aed0-5eff8cc5032c', 'resource', 'qa', 'celery_task_id', '51f2105d-85b1-4393-b821-ac11475919d9', NULL, '', '2012-04-20 21:32:45.553986');\n               INSERT INTO celery_taskmeta (id, task_id, status, result, date_done, traceback) VALUES (2, '51f2105d-85b1-4393-b821-ac11475919d9', 'FAILURE', '52e', '2012-04-20 21:33:01.622557', 'Traceback')" {}

This is because it adds to the celery_taskmeta table, which is not cleared on model.repo.rebuild_db().

It appears the test doesn't even need the value in celery_taskmeta, so we might as well remove that insert.

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

No branches or pull requests

1 participant