Skip to content

Fix ListImages test flaky Before/Since filter ordering#40468

Open
benhillis wants to merge 3 commits intomasterfrom
fix-listimages-test-ordering
Open

Fix ListImages test flaky Before/Since filter ordering#40468
benhillis wants to merge 3 commits intomasterfrom
fix-listimages-test-ordering

Conversation

@benhillis
Copy link
Copy Markdown
Member

The test hardcoded the assumption that debian:latest was created before python:3.12-alpine, but Docker image Created timestamps come from when the image was built in the registry, not when it was pulled or saved. The arm64 test data tars have debian (Mar 16) newer than python (Mar 3), causing the since filter to not return python.

Fix by dynamically determining which image is older/newer based on actual Created timestamps, making the test robust against independently updated test data tars.

The test hardcoded the assumption that debian:latest was created before
python:3.12-alpine, but Docker image Created timestamps come from when
the image was built in the registry, not when it was pulled or saved.
The arm64 test data tars have debian (Mar 16) newer than python (Mar 3),
causing the since filter to not return python.

Fix by dynamically determining which image is older/newer based on
actual Created timestamps, making the test robust against independently
updated test data tars.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 8, 2026 19:08
@benhillis benhillis requested a review from a team as a code owner May 8, 2026 19:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a flaky WSLC ListImages test that assumed a stable creation-time ordering between debian:latest and python:3.12-alpine, even though Docker’s Created timestamps come from the registry image build time and can change independently across test tar updates.

Changes:

  • Captures Created timestamps for the two images under test.
  • Dynamically selects the “older”/“newer” image IDs based on those timestamps before applying since/before filters.
  • Improves test logging to show which image was treated as older/newer.

Comment thread test/windows/WSLCTests.cpp
Comment thread test/windows/WSLCTests.cpp
Ben Hillis and others added 2 commits May 8, 2026 13:00
…inct

Adds explicit VERIFY checks that debianCreated/pythonCreated are > 0 and not equal before using them to choose the since/before boundary, preventing silent fallthrough or ambiguous Docker filter behavior when both images share a Created timestamp.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 8, 2026 21:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +957 to +961
bool foundNewer = false;
for (const auto& image : images)
{
LogInfo("Image: %hs, Hash: %hs, Created: %lld", image.Image, image.Hash, image.Created);
if (std::string{image.Image} == "python:3.12-alpine")
if (std::string{image.Image} == newerName)
Comment on lines +979 to 983
bool foundOlder = false;
for (const auto& image : images)
{
if (std::string{image.Image} == "debian:latest")
if (std::string{image.Image} == olderName)
{
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.

3 participants