-
Notifications
You must be signed in to change notification settings - Fork 695
test:add ci for cleanup fifos #4443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,3 +199,23 @@ func TestStopWithTimeout(t *testing.T) { | |
// The container should get the SIGKILL before the 10s default timeout | ||
assert.Assert(t, elapsed < 10*time.Second, "Container did not respect --timeout flag") | ||
} | ||
func TestStopCleanupFIFOs(t *testing.T) { | ||
if rootlessutil.IsRootless() { | ||
t.Skip("/run/containerd/fifo/ doesn't exist on rootless") | ||
} | ||
testutil.DockerIncompatible(t) | ||
base := testutil.NewBase(t) | ||
testContainerName := testutil.Identifier(t) | ||
oldNumFifos, err := countFIFOFiles("/run/containerd/fifo/") | ||
assert.NilError(t, err) | ||
// Stop the container after 2 seconds | ||
go func() { | ||
time.Sleep(2 * time.Second) | ||
base.Cmd("stop", testContainerName).AssertOK() | ||
newNumFifos, err := countFIFOFiles("/run/containerd/fifo/") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test compares global counts in 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
assert.NilError(t, err) | ||
assert.Equal(t, oldNumFifos, newNumFifos) | ||
}() | ||
// Start a container that is automatically removed after it exits | ||
base.Cmd("run", "--rm", "--name", testContainerName, testutil.NginxAlpineImage).AssertOK() | ||
} |
There was a problem hiding this comment.
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 ?