mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Testcase: Change time comparison logic.
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
This commit is contained in:
parent
2d467dc8d0
commit
56c5668068
1 changed files with 1 additions and 1 deletions
|
@ -103,7 +103,7 @@ func TestVolumesInspect(t *testing.T) {
|
|||
// comparing CreatedAt field time for the new volume to now. Truncate to 1 minute precision to avoid false positive
|
||||
createdAt, err := time.Parse(time.RFC3339, strings.TrimSpace(inspected.CreatedAt))
|
||||
assert.NilError(t, err)
|
||||
assert.Check(t, createdAt.Truncate(time.Minute).Equal(now.Truncate(time.Minute)), "CreatedAt (%s) not equal to creation time (%s)", createdAt, now)
|
||||
assert.Check(t, createdAt.Unix()-now.Unix() < 60, "CreatedAt (%s) exceeds creation time (%s) 60s", createdAt, now)
|
||||
}
|
||||
|
||||
func TestVolumesInvalidJSON(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue