瀏覽代碼

Merge pull request #35808 from thaJeztah/prevent-panic-in-test

Prevent potential panic in TestLogsAPIUntil
Daniel Nephin 7 年之前
父節點
當前提交
602bce175b
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      integration-cli/docker_api_logs_test.go

+ 2 - 0
integration-cli/docker_api_logs_test.go

@@ -172,6 +172,8 @@ func (s *DockerSuite) TestLogsAPIUntil(c *check.C) {
 
 	// Get timestamp of second log line
 	allLogs := extractBody(c, types.ContainerLogsOptions{Timestamps: true, ShowStdout: true})
+	c.Assert(len(allLogs), checker.GreaterOrEqualThan, 3)
+
 	t, err := time.Parse(time.RFC3339Nano, strings.Split(allLogs[1], " ")[0])
 	c.Assert(err, checker.IsNil)
 	until := t.Format(time.RFC3339Nano)