Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Integration tests were timing out in CI due to unbounded Docker image pulls during test execution. The eclipse-mosquitto:latest image pull could hang indefinitely without timeout handling.

Changes

CI workflow

  • Pre-pull eclipse-mosquitto:latest with 300s timeout before test execution

Test fixtures

  • Add pull_docker_image_with_timeout() helper with configurable timeout (default: 300s)
  • Check image availability before container creation; pull with timeout if missing
  • Improve error messages for Docker daemon and network failures

Makefile

  • Remove CI skip condition for integration tests

Implementation

def pull_docker_image_with_timeout(
    docker_client: docker.DockerClient, image: str, timeout: int = DOCKER_PULL_TIMEOUT
) -> None:
    """Pull a Docker image with a timeout."""
    import concurrent.futures

    def _pull_image() -> None:
        try:
            docker_client.images.pull(image)
        except docker.errors.APIError as e:
            raise RuntimeError(f"Failed to pull Docker image {image}. Error: {e}") from e

    with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
        future = executor.submit(_pull_image)
        try:
            future.result(timeout=timeout)
        except concurrent.futures.TimeoutError as e:
            raise TimeoutError(f"Timeout pulling {image} after {timeout}s") from e

The fixture now checks for image availability and pulls with timeout only if needed, preventing the implicit unbounded pull during containers.run().

Original prompt

This section details on the original issue you should resolve

<issue_title>CI: Integration Tests Fail With Timeout</issue_title>
<issue_description>Here's an example. Looks like pulling the image from the Docker Hub hangs. Need to figure out why.</issue_description>

Comments on the Issue (you are @copilot in this section)

@rnovatorov @copilot, maybe you know what's the problem here?

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 30, 2026 14:04
- Add Docker image pre-pull step to CI workflow before running tests
- Add explicit image pull with error handling in test fixtures
- Remove CI skip condition for integration tests
- Improve error messages for Docker-related failures

Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
- Add 300-second timeout to docker pull in CI workflow
- Implement pull_docker_image_with_timeout helper with proper timeout
- Add better error handling for Docker daemon issues
- Address code review feedback

Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI integration tests timeout issue Fix integration test timeouts in CI Jan 30, 2026
Copilot AI requested a review from rnovatorov January 30, 2026 14:14
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

Successfully merging this pull request may close these issues.

CI: Integration Tests Fail With Timeout

2 participants