@@ -37,7 +37,7 @@ import (
37
37
// TestAddons tests addons that require no special environment -- in parallel
38
38
func TestAddons (t * testing.T ) {
39
39
profile := UniqueProfileName ("addons" )
40
- ctx , cancel := context .WithTimeout (context .Background (), 40 * time . Minute )
40
+ ctx , cancel := context .WithTimeout (context .Background (), Minutes ( 40 ) )
41
41
defer CleanupWithLogs (t , profile , cancel )
42
42
43
43
args := append ([]string {"start" , "-p" , profile , "--wait=false" , "--memory=2600" , "--alsologtostderr" , "-v=1" , "--addons=ingress" , "--addons=registry" , "--addons=metrics-server" }, StartArgs ()... )
@@ -90,10 +90,10 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
90
90
t .Fatalf ("kubernetes client: %v" , client )
91
91
}
92
92
93
- if err := kapi .WaitForDeploymentToStabilize (client , "kube-system" , "nginx-ingress-controller" , 6 * time . Minute ); err != nil {
93
+ if err := kapi .WaitForDeploymentToStabilize (client , "kube-system" , "nginx-ingress-controller" , Minutes ( 6 ) ); err != nil {
94
94
t .Errorf ("waiting for ingress-controller deployment to stabilize: %v" , err )
95
95
}
96
- if _ , err := PodWait (ctx , t , profile , "kube-system" , "app.kubernetes.io/name=nginx-ingress-controller" , 12 * time . Minute ); err != nil {
96
+ if _ , err := PodWait (ctx , t , profile , "kube-system" , "app.kubernetes.io/name=nginx-ingress-controller" , Minutes ( 12 ) ); err != nil {
97
97
t .Fatalf ("wait: %v" , err )
98
98
}
99
99
@@ -106,10 +106,10 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
106
106
t .Errorf ("%s failed: %v" , rr .Args , err )
107
107
}
108
108
109
- if _ , err := PodWait (ctx , t , profile , "default" , "run=nginx" , 4 * time . Minute ); err != nil {
109
+ if _ , err := PodWait (ctx , t , profile , "default" , "run=nginx" , Minutes ( 4 ) ); err != nil {
110
110
t .Fatalf ("wait: %v" , err )
111
111
}
112
- if err := kapi .WaitForService (client , "default" , "nginx" , true , time .Millisecond * 500 , time . Minute * 10 ); err != nil {
112
+ if err := kapi .WaitForService (client , "default" , "nginx" , true , time .Millisecond * 500 , Minutes ( 10 ) ); err != nil {
113
113
t .Errorf ("Error waiting for nginx service to be up" )
114
114
}
115
115
@@ -128,7 +128,7 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
128
128
return nil
129
129
}
130
130
131
- if err := retry .Expo (checkIngress , 500 * time .Millisecond , time . Minute ); err != nil {
131
+ if err := retry .Expo (checkIngress , 500 * time .Millisecond , Minutes ( 1 ) ); err != nil {
132
132
t .Errorf ("ingress never responded as expected on 127.0.0.1:80: %v" , err )
133
133
}
134
134
@@ -145,15 +145,15 @@ func validateRegistryAddon(ctx context.Context, t *testing.T, profile string) {
145
145
}
146
146
147
147
start := time .Now ()
148
- if err := kapi .WaitForRCToStabilize (client , "kube-system" , "registry" , 6 * time . Minute ); err != nil {
148
+ if err := kapi .WaitForRCToStabilize (client , "kube-system" , "registry" , Minutes ( 6 ) ); err != nil {
149
149
t .Errorf ("waiting for registry replicacontroller to stabilize: %v" , err )
150
150
}
151
151
t .Logf ("registry stabilized in %s" , time .Since (start ))
152
152
153
- if _ , err := PodWait (ctx , t , profile , "kube-system" , "actual-registry=true" , 6 * time . Minute ); err != nil {
153
+ if _ , err := PodWait (ctx , t , profile , "kube-system" , "actual-registry=true" , Minutes ( 6 ) ); err != nil {
154
154
t .Fatalf ("wait: %v" , err )
155
155
}
156
- if _ , err := PodWait (ctx , t , profile , "kube-system" , "registry-proxy=true" , 10 * time . Minute ); err != nil {
156
+ if _ , err := PodWait (ctx , t , profile , "kube-system" , "registry-proxy=true" , Minutes ( 10 ) ); err != nil {
157
157
t .Fatalf ("wait: %v" , err )
158
158
}
159
159
@@ -198,7 +198,7 @@ func validateRegistryAddon(ctx context.Context, t *testing.T, profile string) {
198
198
return nil
199
199
}
200
200
201
- if err := retry .Expo (checkExternalAccess , 500 * time .Millisecond , 2 * time . Minute ); err != nil {
201
+ if err := retry .Expo (checkExternalAccess , 500 * time .Millisecond , Minutes ( 2 ) ); err != nil {
202
202
t .Errorf (err .Error ())
203
203
}
204
204
@@ -215,12 +215,12 @@ func validateMetricsServerAddon(ctx context.Context, t *testing.T, profile strin
215
215
}
216
216
217
217
start := time .Now ()
218
- if err := kapi .WaitForDeploymentToStabilize (client , "kube-system" , "metrics-server" , 6 * time . Minute ); err != nil {
218
+ if err := kapi .WaitForDeploymentToStabilize (client , "kube-system" , "metrics-server" , Minutes ( 6 ) ); err != nil {
219
219
t .Errorf ("waiting for metrics-server deployment to stabilize: %v" , err )
220
220
}
221
221
t .Logf ("metrics-server stabilized in %s" , time .Since (start ))
222
222
223
- if _ , err := PodWait (ctx , t , profile , "kube-system" , "k8s-app=metrics-server" , 6 * time . Minute ); err != nil {
223
+ if _ , err := PodWait (ctx , t , profile , "kube-system" , "k8s-app=metrics-server" , Minutes ( 6 ) ); err != nil {
224
224
t .Fatalf ("wait: %v" , err )
225
225
}
226
226
@@ -240,7 +240,7 @@ func validateMetricsServerAddon(ctx context.Context, t *testing.T, profile strin
240
240
}
241
241
242
242
// metrics-server takes some time to be able to collect metrics
243
- if err := retry .Expo (checkMetricsServer , time . Minute , 5 * time . Minute ); err != nil {
243
+ if err := retry .Expo (checkMetricsServer , Seconds ( 13 ), Minutes ( 6 ) ); err != nil {
244
244
t .Errorf (err .Error ())
245
245
}
246
246
0 commit comments