@@ -1110,23 +1110,22 @@ func (s *DockerSuite) TestCliRunRestartMaxRetries(c *check.C) {
11101110 printTestCaseName ()
11111111 defer printTestDuration (time .Now ())
11121112 pullImageIfNotExist ("busybox" )
1113- out , _ := dockerCmd (c , "run" , "-d" , "--restart=on-failure:3" , "busybox" , "sh" , "-c" , "sleep 20; false" )
1114- timeout := 100 * time .Second
1115- if daemonPlatform == "windows" {
1116- timeout = 45 * time .Second
1117- }
1113+
1114+ RETRY_COUNT := "3"
1115+ out , _ := dockerCmd (c , "run" , "-d" , "--restart=on-failure:" + RETRY_COUNT , "busybox" , "sh" , "-c" , "sleep 35; false" )
1116+ timeout := 120 * time .Second
11181117
11191118 time .Sleep (timeout )
11201119 id := strings .TrimSpace (string (out ))
11211120
11221121 count := inspectField (c , id , "RestartCount" )
1123- if count != "3" {
1124- c .Fatalf ("Container was restarted %s times, expected %d" , count , 3 )
1122+ if count != RETRY_COUNT {
1123+ c .Fatalf ("Container was restarted %s times, expected %d" , count , RETRY_COUNT )
11251124 }
11261125
11271126 MaximumRetryCount := inspectField (c , id , "HostConfig.RestartPolicy.MaximumRetryCount" )
1128- if MaximumRetryCount != "3" {
1129- c .Fatalf ("Container Maximum Retry Count is %s, expected %s" , MaximumRetryCount , "3" )
1127+ if MaximumRetryCount != RETRY_COUNT {
1128+ c .Fatalf ("Container Maximum Retry Count is %s, expected %s" , MaximumRetryCount , RETRY_COUNT )
11301129 }
11311130}
11321131
0 commit comments