Project

Profile

Help

Issue #9010

closed

post upgrade test is failing intermittently

Added by dkliban@redhat.com over 3 years ago. Updated about 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
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 100
Quarter:

Description

I am seeing the following in our CI from time to time:

pulpcore/tests/upgrade/post/test_publish.py::PublishAnyRepoVersionTestCase::test_all FAILED [ 50%]
pulpcore/tests/upgrade/post/test_publish.py::PublishAnyRepoVersionTestCase::test_custom_manifest PASSED [100%]

=================================== FAILURES ===================================
____________________ PublishAnyRepoVersionTestCase.test_all ____________________

self = <pulpcore.tests.upgrade.post.test_publish.PublishAnyRepoVersionTestCase testMethod=test_all>

    def test_all(self):
        """Test whether a particular repository version can be published.
    
        1. Create a repository with at least 2 repository versions.
        2. Create a publication by supplying the latest ``repository_version``.
        3. Assert that the publication ``repository_version`` attribute points
           to the latest repository version.
        4. Create a publication by supplying the non-latest ``repository_version``.
        5. Create distribution.
        6. Assert that the publication ``repository_version`` attribute points
           to the supplied repository version.
        7. Assert that an exception is raised when providing two different
           repository versions to be published at same time.
        """
        # Step 1
        for file_content in get_content(self.repo.to_dict())[FILE_CONTENT_NAME]:
            repository_modify_data = RepositoryAddRemoveContent(
                remove_content_units=[file_content["pulp_href"]]
            )
            modify_response = self.repo_api.modify(self.repo.pulp_href, repository_modify_data)
            monitor_task(modify_response.task)
        version_hrefs = tuple(ver["pulp_href"] for ver in get_versions(self.repo.to_dict()))
>       non_latest = choice(version_hrefs[:-1])

pulpcore/tests/upgrade/post/test_publish.py:90: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <random.Random object at 0x560e307bd6e0>, seq = ()

    def choice(self, seq):
        """Choose a random element from a non-empty sequence."""
        try:
            i = self._randbelow(len(seq))
        except ValueError:
>           raise IndexError('Cannot choose from an empty sequence') from None
E           IndexError: Cannot choose from an empty sequence

/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/random.py:261: IndexError
========================= 1 failed, 1 passed in 3.21s ==========================

Also available in: Atom PDF