Skip to content
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

Replace Testing Usage of rand.New() with acctest.RandInt() #4625

Closed
bflad opened this issue May 23, 2018 · 2 comments
Closed

Replace Testing Usage of rand.New() with acctest.RandInt() #4625

bflad opened this issue May 23, 2018 · 2 comments
Labels
technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented May 23, 2018

There is still some lingering usage of the following in the provider tests:

rand.New(rand.NewSource(time.Now().UnixNano())).Int()

Which can be replaced with:

acctest.RandInt()

They are functionally equivalent, but its much simpler to read. https://github.com/hashicorp/terraform/blob/0cc9e050ecd4a46ba6448758c2edc0b29bef5695/helper/acctest/random.go#L23-L26

@bflad
Copy link
Contributor Author

bflad commented May 29, 2018

These have all been fixed 👍

@bflad bflad closed this as completed May 29, 2018
@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

No branches or pull requests

1 participant