瀏覽代碼

Try to fix #20942 TestContainerPsContext unit test

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Vincent Demeester 9 年之前
父節點
當前提交
2787072a65
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      api/client/formatter/custom_test.go

+ 2 - 2
api/client/formatter/custom_test.go

@@ -12,7 +12,7 @@ import (
 
 func TestContainerPsContext(t *testing.T) {
 	containerID := stringid.GenerateRandomID()
-	unix := time.Now().Unix()
+	unix := time.Now().Add(-65 * time.Second).Unix()
 
 	var ctx containerContext
 	cases := []struct {
@@ -55,7 +55,7 @@ func TestContainerPsContext(t *testing.T) {
 		{types.Container{SizeRw: 10, SizeRootFs: 20}, true, "10 B (virtual 20 B)", sizeHeader, ctx.Size},
 		{types.Container{}, true, "", labelsHeader, ctx.Labels},
 		{types.Container{Labels: map[string]string{"cpu": "6", "storage": "ssd"}}, true, "cpu=6,storage=ssd", labelsHeader, ctx.Labels},
-		{types.Container{Created: unix}, true, "Less than a second", runningForHeader, ctx.RunningFor},
+		{types.Container{Created: unix}, true, "About a minute", runningForHeader, ctx.RunningFor},
 	}
 
 	for _, c := range cases {