Skip to content

Handle sub second pulls in LoggedPullImageResultCallback#11417

Open
cgunning wants to merge 1 commit intotestcontainers:mainfrom
cgunning:bug/dont-throw-on-sub-second-pulls
Open

Handle sub second pulls in LoggedPullImageResultCallback#11417
cgunning wants to merge 1 commit intotestcontainers:mainfrom
cgunning:bug/dont-throw-on-sub-second-pulls

Conversation

@cgunning
Copy link
Copy Markdown

@cgunning cgunning commented Jan 7, 2026

Mitigates the issues described in [Bug]: LoggedPullImageResultCallback throws java.lang.ArithmeticException: / by zero.

From the issue:
When running tests in GitHub actions, it fails due to line 121 in LoggedPullImageResultCallback throws an java.lang.ArithmeticException: / by zero. Out of 10 times running our tests, it has failed 8 times and succeeded2. I have not been able to reproduce this in a reliable way but it seems like this would happen if a pull takes less than one full second since duration will become 0.

Copy link
Copy Markdown
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems obvious in retrospect - I'm surprised it's taken so long for somebody to encounter this problem! This solution looks good to me. Thanks for the investigation and fix.

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.

2 participants