Skip to content

Commit 1207699

Browse files
committed
Bump E2E go test timeout to 20m
1 parent 191be85 commit 1207699

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

test/e2e/tests/multi_zone_e2e_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"strings"
2020

2121
csi "github.com/container-storage-interface/spec/lib/go/csi"
22+
"github.com/golang/glog"
2223
. "github.com/onsi/ginkgo"
2324
. "github.com/onsi/gomega"
2425
"k8s.io/apimachinery/pkg/util/sets"
@@ -145,7 +146,7 @@ var _ = Describe("GCE PD CSI Driver Multi-Zone", func() {
145146
func testAttachWriteReadDetach(volID string, volName string, instance *remote.InstanceInfo, client *remote.CsiClient, readOnly bool) {
146147
var err error
147148

148-
Logf("Starting testAttachWriteReadDetach with volume %v node %v with readonly %v\n", volID, instance.GetNodeID(), readOnly)
149+
glog.Infof("Starting testAttachWriteReadDetach with volume %v node %v with readonly %v\n", volID, instance.GetNodeID(), readOnly)
149150
// Attach Disk
150151
err = client.ControllerPublishVolume(volID, instance.GetNodeID())
151152
Expect(err).To(BeNil(), "ControllerPublishVolume failed with error for disk %v on node %v", volID, instance.GetNodeID())
@@ -205,5 +206,5 @@ func testAttachWriteReadDetach(volID string, volName string, instance *remote.In
205206
err = client.NodeUnpublishVolume(volID, secondPublishDir)
206207
Expect(err).To(BeNil(), "NodeUnpublishVolume failed with error")
207208

208-
Logf("Completed testAttachWriteReadDetach with volume %v node %v\n", volID, instance.GetNodeID())
209+
glog.Infof("Completed testAttachWriteReadDetach with volume %v node %v\n", volID, instance.GetNodeID())
209210
}

test/e2e/tests/setup_e2e_test.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"testing"
2222
"time"
2323

24+
"github.com/golang/glog"
2425
. "github.com/onsi/ginkgo"
2526
. "github.com/onsi/gomega"
2627
computebeta "google.golang.org/api/compute/v0.beta"
@@ -68,27 +69,32 @@ var _ = BeforeSuite(func() {
6869
Expect(*project).ToNot(BeEmpty(), "Project should not be empty")
6970
Expect(*serviceAccount).ToNot(BeEmpty(), "Service account should not be empty")
7071

71-
Logf("Running in project %v with service account %v\n\n", *project, *serviceAccount)
72+
glog.Infof("Running in project %v with service account %v\n\n", *project, *serviceAccount)
7273

7374
for _, zone := range zones {
7475
go func(curZone string) {
7576
defer GinkgoRecover()
7677
nodeID := fmt.Sprintf("gce-pd-csi-e2e-%s", curZone)
77-
Logf("Setting up node %s\n", nodeID)
78+
glog.Infof("Setting up node %s\n", nodeID)
7879

7980
i, err := remote.SetupInstance(*project, curZone, nodeID, *serviceAccount, computeService)
80-
Expect(err).To(BeNil())
81+
if err != nil {
82+
glog.Fatalf("Failed to setup instance %v: %v", nodeID, err)
83+
}
8184

85+
glog.Infof("Creating new driver and client for node %s\n", i.GetName())
8286
// Create new driver and client
8387
testContext, err := testutils.GCEClientAndDriverSetup(i)
84-
Expect(err).To(BeNil(), "Set up new Driver and Client failed with error")
88+
if err != nil {
89+
glog.Fatalf("Failed to set up Test Context for instance %v: %v", i.GetName(), err)
90+
}
8591
tcc <- testContext
8692
}(zone)
8793
}
8894

8995
for i := 0; i < len(zones); i++ {
9096
tc := <-tcc
91-
Logf("Test Context for node %s set up\n", tc.Instance.GetName())
97+
glog.Infof("Test Context for node %s set up\n", tc.Instance.GetName())
9298
testContexts = append(testContexts, tc)
9399
}
94100
})

test/e2e/tests/single_zone_e2e_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ limitations under the License.
1515
package tests
1616

1717
import (
18-
"fmt"
1918
"strings"
2019
"time"
2120

@@ -369,7 +368,3 @@ var _ = Describe("GCE PD CSI Driver", func() {
369368
}()
370369
})
371370
})
372-
373-
func Logf(format string, args ...interface{}) {
374-
fmt.Fprintf(GinkgoWriter, format, args...)
375-
}

test/remote/instance.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (i *InstanceInfo) CreateOrGetInstance(serviceAccount string) error {
8989
return fmt.Errorf("Failed to create firewall rule: %v", err)
9090
}
9191

92-
imageURL := "projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-1804-lts"
92+
imageURL := "projects/debian-cloud/global/images/family/debian-9"
9393
inst := &compute.Instance{
9494
Name: i.name,
9595
MachineType: machineType(i.zone, ""),
@@ -132,7 +132,7 @@ func (i *InstanceInfo) CreateOrGetInstance(serviceAccount string) error {
132132

133133
if _, err := i.computeService.Instances.Get(i.project, i.zone, inst.Name).Do(); err != nil {
134134
op, err := i.computeService.Instances.Insert(i.project, i.zone, inst).Do()
135-
glog.V(4).Infof("Inserted instance %v in project %v, i.zone %v", inst.Name, i.project, i.zone)
135+
glog.V(4).Infof("Inserted instance %v in project: %v, zone: %v", inst.Name, i.project, i.zone)
136136
if err != nil {
137137
ret := fmt.Sprintf("could not create instance %s: API error: %v", i.name, err)
138138
if op != nil {

test/run-e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -x
55

66
readonly PKGDIR=sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
77

8-
go test --v=true "${PKGDIR}/test/e2e/tests" --logtostderr --run-in-prow=true --delete-instances=true
8+
go test --timeout 20m --v "${PKGDIR}/test/e2e/tests" --logtostderr --run-in-prow=true --delete-instances=true -args -v=10

0 commit comments

Comments
 (0)