Project

Profile

Help

Issue #8911

closed

Fix pull test that fails interminently

Added by ipanova@redhat.com almost 3 years ago. Updated almost 3 years ago.

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

Description

https://github.com/pulp/pulp_container/runs/2839308118

The test would fail some times because the artifact after being streamed to the client would not be saved before assertion for the artifact_count

def test_pull_image_from_repository(self):
        """Verify that a client can pull the image from Pulp (on-demand).
    
        1. Using the RegistryClient pull the image from Pulp.
        2. Pull the same image from remote registry.
        3. Verify both images has the same checksum.
        4. Verify that the number of artifacts in Pulp has increased.
        5. Ensure image is deleted after the test.
        """
        registry = cli.RegistryClient(self.cfg)
        registry.raise_if_unsupported(unittest.SkipTest, "Test requires podman/docker")
        registry.login("-u", "admin", "-p", "password", self.registry_name)
    
        local_url = urljoin(self.cfg.get_base_url(), self.distribution_with_repo.base_path)
    
        registry.pull(local_url)
        self.teardown_cleanups.append((registry.rmi, local_url))
        local_image = registry.inspect(local_url)
    
        registry.pull(REPO_UPSTREAM_NAME)
        remote_image = registry.inspect(REPO_UPSTREAM_NAME)
    
        self.assertEqual(local_image[0]["Id"], remote_image[0]["Id"])
    
        new_artifact_count = self.artifacts_api.list().count
>       self.assertGreater(new_artifact_count, self.artifact_count)
E       AssertionError: 33 not greater than 33

Related issues

Is duplicate of Pulp - Issue #8980: content app finishes servicing on_demand content requests before artifacts are fully savedCLOSED - CURRENTRELEASEdkliban@redhat.comActions

Also available in: Atom PDF