1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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

Prevent potential panic in TestLogsAPIUntil
This commit is contained in:
Daniel Nephin 2017-12-19 11:16:00 -05:00 committed by GitHub
commit 602bce175b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)