containerd / nerdctl

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...
Apache License 2.0
7.63k stars 565 forks source link

Some tests seem to run multiple times the command they are testing because of the way AssertOutContains is used #3102

Closed apostasie closed 2 weeks ago

apostasie commented 2 weeks ago

Description

For example https://github.com/containerd/nerdctl/blob/main/cmd/nerdctl/container_run_network_linux_test.go#L491

Since we first call AssertOK, then AssertOutContains, the command is run twice.

This is quite problematic. If we want to make these helpers friendlier / easier to use for people, we should maintain a state that would prevent multiple runs. At least, we should do a quick review of the codebase and make sure we fix this specific pattern.

Steps to reproduce the issue

na

Describe the results you received and expected

na

What version of nerdctl are you using?

1.7.6

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response