diff --git a/Makefile b/Makefile index 419b18980..4cef18c39 100644 --- a/Makefile +++ b/Makefile @@ -44,12 +44,10 @@ test-smoke: cd test && make test-smoke TEST_TIMEOUT=$(TEST_TIMEOUT) build: vet lint - go build ./... - cd k8s && go build ./... + go build work vet: - go vet ./... - cd k8s && go vet ./... + go vet work lint: ifeq ($(SKIP_LINT), 1) diff --git a/client.go b/client.go index 6e96081d8..9cb2176e6 100644 --- a/client.go +++ b/client.go @@ -622,8 +622,11 @@ func (c *Client) doRequest(ctx context.Context, method, endpoint string, params waitTime = c.retryMaxWaitTime } - // Sleep for the calculated duration before retrying - time.Sleep(waitTime) + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(waitTime): + } } return err diff --git a/test/unit/vpc_subnets_test.go b/test/unit/vpc_subnets_test.go index 8d7b9471c..88435b496 100644 --- a/test/unit/vpc_subnets_test.go +++ b/test/unit/vpc_subnets_test.go @@ -23,7 +23,7 @@ func TestVPCSubnet_Create(t *testing.T) { IPv4: "192.168.1.0/24", IPv6: []linodego.VPCSubnetCreateOptionsIPv6{ { - linodego.Pointer("auto"), + Range: linodego.Pointer("auto"), }, }, }