Skip to content

Commit

Permalink
Add deadline to TestCreateDisk: controller context deadline exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSirenko committed Feb 21, 2024
1 parent 0e826b2 commit fbf742b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cloud/cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const (
defaultVolumeID = "vol-test-1234"
defaultNodeID = "node-1234"
defaultPath = "/dev/xvdaa"

defaultCreateDiskDeadline = time.Second * 5
)

func generateVolumes(volIdCount, volTagCount int) []*ec2.Volume {
Expand Down Expand Up @@ -807,7 +809,8 @@ func TestCreateDisk(t *testing.T) {
VolumeId: aws.String("snap-test-volume"),
State: aws.String("completed"),
}
ctx := context.Background()
ctx, ctxCancel := context.WithDeadline(context.Background(), time.Now().Add(defaultCreateDiskDeadline))
defer ctxCancel()

if tc.expCreateVolumeInput != nil {
matcher := eqCreateVolume(tc.expCreateVolumeInput)
Expand Down

0 comments on commit fbf742b

Please sign in to comment.