Skip to content

test: refactor container_run_restart_linux_test.go to use Tigron#4916

Merged
AkihiroSuda merged 1 commit into
containerd:mainfrom
opjt:issues_4613_container_run_restart_linux_test.go
Jun 1, 2026
Merged

test: refactor container_run_restart_linux_test.go to use Tigron#4916
AkihiroSuda merged 1 commit into
containerd:mainfrom
opjt:issues_4613_container_run_restart_linux_test.go

Conversation

@opjt
Copy link
Copy Markdown
Contributor

@opjt opjt commented May 18, 2026

Review point

1. killDaemon / ensureDaemonActive / dumpDaemonLogs location

These helpers were previously methods on testutil.Base and are used only by TestRunRestart in this file.
I've kept them inline (package-private functions) in the test file

if the project expects more daemon-resilience tests in the future, moving them to pkg/testutil/nerdtest/ (e.g., daemon_linux.go) as exported helpers make sense.

2. nerdtest.ContainerdPlugin plugin type

The migrated tests keep io.containerd.internal.v1 to match original behavior. In newer containerd (verified on v2.2.1) this plugin has moved:

$ sudo ctr plugins ls | grep restart
io.containerd.monitor.container.v1   restart   -   ok

As a result, the 4 tests skip on the v2.x CI jobs but still run on the legacy jobs.
Updating the type (or supporting both) is left as a follow-up.

@opjt opjt marked this pull request as draft May 18, 2026 23:53
@opjt opjt force-pushed the issues_4613_container_run_restart_linux_test.go branch 2 times, most recently from 15e1509 to a358a18 Compare May 19, 2026 03:32
@opjt opjt marked this pull request as ready for review May 19, 2026 08:36
@AkihiroSuda AkihiroSuda added this to the v2.3.2 milestone May 28, 2026
if err == nil {
// The daemon is now running, but the daemon may still refuse connections to containerd.sock
t.Log(fmt.Sprintf("daemon %q is now running, checking whether the daemon can handle requests", target))
infoOut, infoErr := exec.Command(testutil.GetTarget(), "info").CombinedOutput()
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.

Why not use helpers.Command?

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.

The loop needs to know whether info succeeded without failing the test on intermediate attempts.
As far as I could find, Tigron doesn't offer a way to do both:

  • Run returns nothing
  • Ensure/Capture fatal on non-zero exit, and Anyhow doesn't expose success.

exec.Command was the simplest fit. Open to suggestions if there's a pattern I missed.

@opjt opjt force-pushed the issues_4613_container_run_restart_linux_test.go branch from a358a18 to b08f8af Compare May 28, 2026 23:05
Comment thread pkg/testutil/nerdtest/requirements.go Outdated
@opjt opjt requested a review from AkihiroSuda May 30, 2026 21:47
Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Signed-off-by: Park jungtae <jtpark1957@gmail.com>
@opjt opjt force-pushed the issues_4613_container_run_restart_linux_test.go branch from b08f8af to 8631217 Compare June 1, 2026 12:52
@opjt opjt requested a review from AkihiroSuda June 1, 2026 13:48
Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 1dec0bc into containerd:main Jun 1, 2026
93 of 100 checks passed
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