Skip to content

Conversation

ningmingxiao
Copy link
Contributor

@ningmingxiao ningmingxiao commented Aug 5, 2025

add some ci for #4316

@ningmingxiao ningmingxiao force-pushed the add_ci branch 2 times, most recently from c4a36e1 to caea35f Compare August 5, 2025 02:28
@fahedouch
Copy link
Member

is it possible to fix on the same PR #4316 ?

@ningmingxiao
Copy link
Contributor Author

ningmingxiao commented Aug 5, 2025

is it possible to fix on the same PR #4316 ?
pr 4316 long time noby answer, you can mege it and then merge my pr.
and i think we should call io.Close() after @fahedouch

case status := <-exitCh:

@fahedouch
Copy link
Member

Some suggestions:

  • Close IO even when task is already Stopped:

    • In Stop, for the early return case case containerd.Stopped, consider closing IO before returning to prevent leaving FIFOs up until another path cleans them:
      • Example change:
        • Before return nil for containerd.Stopped, do:
          • if io := task.IO(); io != nil { if err := io.Close(); err != nil { log.Warnf(...) } }
    • Some shims/plugins may leave IO present until an explicit close; proactively closing avoids FIFO linger in this rare path.
  • Log levels/messages:

    • The warning on IO close failure is good. Optionally include more context (namespace, task pid if available) for easier troubleshooting.

@fahedouch
Copy link
Member

fahedouch commented Aug 12, 2025

CI is failing

@ningmingxiao ningmingxiao force-pushed the add_ci branch 2 times, most recently from 47ef295 to 0843678 Compare August 15, 2025 09:30
@ningmingxiao
Copy link
Contributor Author

done

oldNumFifos, err := countFIFOFiles("/run/containerd/fifo/")
assert.NilError(t, err)
// Stop the container after 2 seconds
go func() {
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to avoid goroutine and make sequential check to avoid synchronisation issues and then flaky tests ?

go func() {
time.Sleep(2 * time.Second)
base.Cmd("stop", testContainerName).AssertOK()
newNumFifos, err := countFIFOFiles("/run/containerd/fifo/")
Copy link
Member

Choose a reason for hiding this comment

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

The test compares global counts in /run/containerd/fifo/. If other tests run in parallel and create/cleanup tasks, the global count may fluctuate, making the test flaky:

option: Prefer filtering by container/task ID in the FIFO names, if possible. Otherwise, add a short stabilization poll or mark the test as non-parallel and document the global dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if don't use t.Parallel() the test cases will execute serially. if this testcase is running other test case with t.Parallel() will not run.

Signed-off-by: ningmingxiao <[email protected]>
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