Skip to content

Commit a5d1701

Browse files
committed
test: remove unnecessary sleep in container setup for log tests
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
1 parent 87a976d commit a5d1701

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cmd/nerdctl/container/container_logs_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,8 @@ func TestLogsFollowNoExtraneousLineFeed(t *testing.T) {
401401

402402
testCase.Setup = func(data test.Data, helpers test.Helpers) {
403403
// Create a container that outputs a message without a trailing newline
404-
// and then sleeps to keep the container running for the logs -f command
405404
helpers.Ensure("run", "-d", "--name", data.Identifier(), testutil.CommonImage,
406-
"sh", "-c", "printf 'Hello without newline'; sleep 5")
405+
"sh", "-c", "printf 'Hello without newline'")
407406
}
408407

409408
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
@@ -412,7 +411,6 @@ func TestLogsFollowNoExtraneousLineFeed(t *testing.T) {
412411

413412
testCase.Command = func(data test.Data, helpers test.Helpers) test.TestableCommand {
414413
// Use logs -f to follow the logs
415-
// The container will exit after 5 seconds, so we don't need an explicit timeout
416414
// Arbitrary, but we need to wait until the logs show up
417415
time.Sleep(3 * time.Second)
418416
return helpers.Command("logs", "-f", data.Identifier())

0 commit comments

Comments
 (0)