Skip to content

[CI]: tests cleanup - #4247

Merged
AkihiroSuda merged 2 commits into
containerd:mainfrom
apostasie:2025-05-net-test-cleanup
May 16, 2025
Merged

AkihiroSuda merged 2 commits into
containerd:mainfrom
apostasie:2025-05-net-test-cleanup

Conversation

@apostasie

@apostasie apostasie commented May 15, 2025 •

Copy link
Copy Markdown
Contributor

This is a tentative at fixing:

The hypothesis is that in very slow environments (eg: EL8 under pressure), containers started with -d may not have started by the time we are testing on them, resulting in unspecified behavior (whether this is a bug or not is a separate conversation to be evaluated case by case).

Besides enforcing verification that the container has started, this PR does take the occasion to do some cleanup:

  • remove -d when not necessary
  • use CommonImage instead of Alpine, or Nginx (when not necessary)
  • remove spurious Cleanups when not necessary and replace with self-removing containers
  • simplify syntax (remove spurious use of WithArguments, simplify expectations)
  • more logically organize setup vs. command

I will restart the CI a few times to confirm that EL8 is no longer failing on these.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
@apostasie
apostasie marked this pull request as ready for review May 15, 2025 18:09
},
Cleanup: func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("rmi", "-f", data.Identifier("ignored"))
helpers.Anyhow("rmi", "-f", data.Identifier())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Properly remove leftovers.

data.Labels().Set("containerName1", data.Identifier("-container1"))
containerName1 := data.Labels().Get("containerName1")
helpers.Ensure("run", "-d", "--name", containerName1,
data.Labels().Set("container1", data.Identifier("container1"))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is no need for "-" in suffix - this is added automatically by Identifier

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
@apostasie
apostasie force-pushed the 2025-05-net-test-cleanup branch from 28a3d08 to d9cf528 Compare May 15, 2025 18:15
helpers.Anyhow("rm", "--data-root", data.Temp().Path(), "-f", data.Identifier())
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("run", "--data-root", data.Temp().Path(), "--rm", "--name", data.Identifier(), "-p", "22200-22299:22200-22299", testutil.CommonImage)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Name is useless here, and so is cleanup.

data.Labels().Set("container2", data.Identifier("container2"))
nerdtest.EnsureContainerStarted(helpers, data.Identifier("container2"))
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Splitting this into subtests.

return &test.Expected{
ExitCode: 0,
}
return helpers.Command("run", "--rm", "--uts", "host",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Simplifying.

return &test.Expected{
ExitCode: 1,
}
return helpers.Command("run", "--rm", "--dns", "0.1.2.3",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Simplifying.

ExitCode: 1,
}
},
// 1 for nerdctl, 125 for docker

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unless aligning with docker on exit codes would really matter to us, simplifying.

@apostasie

Copy link
Copy Markdown
Contributor Author

Failures:

  • kube
  • some compose / IPFS

@apostasie apostasie closed this May 15, 2025
@apostasie apostasie reopened this May 15, 2025
@apostasie

Copy link
Copy Markdown
Contributor Author

Failure is #4249

@apostasie apostasie closed this May 15, 2025
@apostasie apostasie reopened this May 15, 2025
@apostasie

Copy link
Copy Markdown
Contributor Author

Failure is Hub 429.

@apostasie

Copy link
Copy Markdown
Contributor Author

Green.

@apostasie apostasie closed this May 15, 2025
@apostasie apostasie reopened this May 15, 2025
@AkihiroSuda AkihiroSuda added this to the v2.1.2 milestone May 15, 2025
@apostasie

Copy link
Copy Markdown
Contributor Author

Green again.

@apostasie apostasie closed this May 15, 2025
@apostasie apostasie reopened this May 15, 2025
@apostasie

Copy link
Copy Markdown
Contributor Author

Green.

I think we can call it and merge - then close the issues linked above.
Note that (assuming I am right on this), we may have a lot of these -d where not waiting for the container to start would flake.
Can look into that as a follow-up.

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

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