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 81be013 commit e1e567f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cloud/cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const (
defaultPath = "/dev/xvdaa"
)

const (
provisionerSidecarDeadline = time.Second * 5
)

func generateVolumes(volIdCount, volTagCount int) []*ec2.Volume {
volumes := make([]*ec2.Volume, 0, volIdCount+volTagCount)

Expand Down Expand Up @@ -807,7 +811,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(provisionerSidecarDeadline))
defer ctxCancel()

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

0 comments on commit e1e567f

Please sign in to comment.