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

Added support for setting seed for deterministic results. #610

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tboloo
Copy link

@tboloo tboloo commented Dec 27, 2024

As of Go 1.20 the math/rand package has been updated to use a stable random number generator by default, also there is no longer a global random number generator (rand.Seed(seed int64)), which would be used by all code in application.
This change restores the previous behavior by passing around the seed to all functions that require random numbers.

As of Go 1.20 the math/rand package has been updated to use a stable random number generator by default,
also there is no longer a global random number generator (`rand.Seed(seed int64)`),
which would be used by all code in application.
This change restores the previous behavior by passing around the seed to all functions that require random numbers.
Toxiproxy can be run with --seed <seed> parameter
to make the runs deterministic.
@tboloo
Copy link
Author

tboloo commented Dec 27, 2024

I have signed the CLA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant