Project

Profile

Help

Issue #6778

closed

content handler test fails every now and then

Added by ttereshc over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 74
Quarter:

Description

It seems that sometines cleanup happens too early. To my knowledge, resources are cleaned after each test method. My guess is that the problem is that all resources and cleanups are introduced in the setUp. And then both test methods re-use the created resources. It seems that cleanup happens either too soon or just for the second time.

It's the only test class written that way. https://github.com/pulp/pulp_rpm/blob/ddb279b1dfba727a548e360388fedcc0e63732bd/pulp_rpm/tests/functional/content_handler/test_config_repo.py#L42-L57

Any other tests we have don't create resources or schedule cleanups in the setUp, everything happens in each test method.

Error seen in Travis:

1753pulp_rpm/tests/functional/content_handler/test_config_repo.py::ContentHandlerTests::testConfigRepoUnsigned PASSED [100%]
1754pulp_rpm/tests/functional/content_handler/test_config_repo.py::ContentHandlerTests::testConfigRepoUnsigned ERROR [100%]
1755
1756==================================== ERRORS ====================================
1757_______ ERROR at teardown of ContentHandlerTests.testConfigRepoUnsigned ________
1758
1759cls = <class 'pulp_rpm.tests.functional.content_handler.test_config_repo.ContentHandlerTests'>
1760
1761    @classmethod
1762    def tearDownClass(cls) -> None:
1763        """Clean up after testing."""
1764        for f, x in cls.cleanUp:
1765>           f(x)
1766
1767pulp_rpm/tests/functional/content_handler/test_config_repo.py:30: 
1768_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1769../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pulpcore/client/pulp_rpm/api/publications_rpm_api.py:174: in delete
1770    return self.delete_with_http_info(rpm_publication_href, **kwargs)  # noqa: E501
1771../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pulpcore/client/pulp_rpm/api/publications_rpm_api.py:253: in delete_with_http_info
1772    collection_formats=collection_formats)
1773../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py:353: in call_api
1774    _preload_content, _request_timeout, _host)
1775../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py:184: in __call_api
1776    _request_timeout=_request_timeout)
1777../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pulpcore/client/pulp_rpm/api_client.py:420: in request
1778    body=body)
1779../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pulpcore/client/pulp_rpm/rest.py:266: in DELETE
1780    body=body)

E           pulpcore.client.pulp_rpm.exceptions.ApiException: (404)
1912E           Reason: Not Found
1913E           HTTP response headers: HTTPHeaderDict({'Server': 'nginx/1.18.0', 'Date': 'Wed, 20 May 2020 07:47:02 GMT', 'Content-Type': 'application/json', 'Content-Length': '23', 'Connection': 'keep-alive', 'Vary': 'Accept, Cookie', 'Allow': 'GET, DELETE, HEAD, OPTIONS', 'X-Frame-Options': 'SAMEORIGIN'})
1914E           HTTP response body: {"detail":"Not found."}
1915
1916../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pulpcore/client/pulp_rpm/rest.py:229: ApiException

Also available in: Atom PDF