Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 79823dc

Browse files
committed
e2e: fix smoke test.
It was using nested loops to create deployments and jobs, creating a bit of a mess. I also bumped the checkpoint waiting period to 60 seconds. Not ideal, but I'm seeing some instances where it takes >30 seconds to pivot back to the parent apiserver pod.
1 parent a6ef5a6 commit 79823dc

File tree

2 files changed

+7
-31
lines changed

2 files changed

+7
-31
lines changed

e2e/checkpointer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ func waitCluster(t *testing.T) *Cluster {
141141
// apiserver-managed ones.
142142
// TODO(diegs): do something more scientific, like talking to docker.
143143
func waitForCheckpointDeactivation(t *testing.T) {
144-
t.Log("Waiting 30 seconds for checkpoints to deactivate.")
145-
time.Sleep(30 * time.Second)
144+
t.Log("Waiting 60 seconds for checkpoints to deactivate.")
145+
time.Sleep(60 * time.Second)
146146
successes := 0
147147
if err := retry(20, 3*time.Second, func() error {
148148
_, err := client.Discovery().ServerVersion()

e2e/smoke_test.go

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,17 @@ package e2e
33
import (
44
"testing"
55

6-
"time"
7-
86
"github.com/coreos/ktestutil/testworkload"
9-
"k8s.io/apimachinery/pkg/util/wait"
10-
)
11-
12-
const (
13-
smokePingPollInterval = 1 * time.Second
14-
smokePingPollTimeout = 1 * time.Minute
157
)
168

179
func TestSmoke(t *testing.T) {
18-
// 1. create nginx testworkload.
19-
var nginx *testworkload.Nginx
20-
if err := wait.Poll(networkPingPollInterval, networkPingPollTimeout, func() (bool, error) {
21-
var err error
22-
if nginx, err = testworkload.NewNginx(client, namespace, testworkload.WithNginxPingJobLabels(map[string]string{"allow": "access"})); err != nil {
23-
t.Logf("failed to create test nginx: %v", err)
24-
return false, nil
25-
}
26-
return true, nil
27-
}); err != nil {
28-
t.Fatalf("failed to create an testworkload: %v", err)
10+
nginx, err := testworkload.NewNginx(client, namespace, testworkload.WithNginxPingJobLabels(map[string]string{"allow": "access"}))
11+
if err != nil {
12+
t.Fatalf("Test nginx creation failed: %v", err)
2913
}
3014
defer nginx.Delete()
3115

32-
// 2. Create a wget pod that hits the nginx.
33-
if err := wait.Poll(smokePingPollInterval, smokePingPollTimeout, func() (bool, error) {
34-
if err := nginx.IsReachable(); err != nil {
35-
t.Logf("error not reachable %s: %v", nginx.Name, err)
36-
return false, nil
37-
}
38-
return true, nil
39-
}); err != nil {
40-
t.Fatalf("couldn't reach the test workload %s: %v", nginx.Name, err)
16+
if err := nginx.IsReachable(); err != nil {
17+
t.Errorf("%s is not reachable: %v", nginx.Name, err)
4118
}
42-
4319
}

0 commit comments

Comments
 (0)