SatelliteQE / robottelo

Robottelo is a test suite that exercises The Foreman.
GNU General Public License v3.0
61 stars 112 forks source link

Actions::Katello::Host::UploadPackageProfile not created right after `yum install -y ...`? #6156

Closed jhutar closed 5 years ago

jhutar commented 6 years ago

Stacktrace:

self = <tests.foreman.longrun.test_inc_updates.IncrementalUpdateTestCase testMethod=test_positive_noapply_api>

    def setUp(self):
        """Creates the pre-requisites for the Incremental updates that used per
            each test"""
        [...]

        # Create client machine and register it to satellite with
        # rhel_6_partial_ak
        self.vm = VirtualMachine(distro=DISTRO_RHEL6, tag='incupdate')
        self.addCleanup(vm_cleanup, self.vm)
        self.setup_vm(self.vm, rhel_6_partial_ak.name, self.org.label)
        self.vm.enable_repo(REPOS['rhva6']['id'])
        timestamp = datetime.utcnow()
        self.vm.run('yum install -y {0}'.format(REAL_0_RH_PACKAGE))

        # Find the content host and ensure that tasks started by package
        # installation has finished
        host = entities.Host().search(
            query={'search': 'name={}'.format(self.vm.hostname)})
        wait_for_tasks(
            search_query='label = Actions::Katello::Host::UploadPackageProfile'
                         ' and resource_id = {}'
>                        ' and started_at >= {}'.format(host[0].id, timestamp)
        )

tests/foreman/longrun/test_inc_updates.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

search_query = 'label = Actions::Katello::Host::UploadPackageProfile and resource_id = 1 and started_at >= 2018-07-28 00:46:53.182263'
search_rate = 1, max_tries = 10, poll_rate = None, poll_timeout = None
rplevka commented 6 years ago

unfortunately, these kind of failures are usually just about timing - although, we might consider the time gap as a bug if it crosses some threshold. We tried to already get as close to the real state as we could by implementing the query for the aforementioned task, however it's sometimes still not just enough. Perhaps we might add one more intermediate step that would actually parse the production.log for the clients PUT request - to at least assure the request arrived - and further isolating the problematic part (which is most probably katello/pulp being low on resources)

ntkathole commented 5 years ago

Please feel free to re-open, if this still needs fixing.