瀏覽代碼

Testcase: Change time comparison logic.

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Jintao Zhang 5 年之前
父節點
當前提交
56c5668068
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      integration/volume/volume_test.go

+ 1 - 1
integration/volume/volume_test.go

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