Skip to content

terraform unit tests depend on calls to terraform registry #2474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spikecurtis opened this issue Jun 17, 2022 · 2 comments
Closed

terraform unit tests depend on calls to terraform registry #2474

spikecurtis opened this issue Jun 17, 2022 · 2 comments
Labels
api Area: HTTP API

Comments

@spikecurtis
Copy link
Contributor

e.g.

    provision_test.go:328: ERROR ╷
    provision_test.go:328: ERROR │Error: Failed to query available provider packages
    provision_test.go:328: ERROR │
    provision_test.go:328: ERROR │Could not retrieve the list of available versions for provider
    provision_test.go:328: ERROR │hashicorp/null: could not query provider registry for
    provision_test.go:328: ERROR │registry.terraform.io/hashicorp/null: the request failed after 2 attempts,
    provision_test.go:328: ERROR │please try again later: Get
    provision_test.go:328: ERROR │"https://registry.terraform.io/v1/providers/hashicorp/null/versions":
    provision_test.go:328: ERROR │net/http: request canceled (Client.Timeout exceeded while awaiting headers)
    provision_test.go:328: ERROR ╵
    provision_test.go:328: ERROR 
    provision_test.go:325: 
        	Error Trace:	provision_test.go:325
        	Error:      	Received unexpected error:
        	            	initialize terraform: exit status 1
        	            		storj.io/drpc/drpcwire.UnmarshalError:26
        	            		storj.io/drpc/drpcstream.(*Stream).HandlePacket:1[98](https://github.com/coder/coder/runs/6940482685?check_suite_focus=true#step:10:99)
        	            		storj.io/drpc/drpcmanager.(*Manager).manageReader:211
        	Test:       	TestProvision_ExtraEnv

These timeouts cause our tests to be flaky (not to mention slow).

@mafredri
Copy link
Member

This seems like a local network issue on the runner (2 tries and we can't even fetch headers?), there are some things mentioned here we can try to do to improve this case: hashicorp/terraform#31157 (comment)

(I'm not saying it's ideal our tests download from a registry, though, it might be a good idea to have a local registry cache that our tests can use.)

@kylecarbs
Copy link
Member

We do this a lot less now since we reference local files for most state parsing and validation. I'm going to mark this as not planned, but if it's still an issue please reopen!

@kylecarbs kylecarbs closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

No branches or pull requests

3 participants