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

Set random.seed explicitly in each test function for rest streaming #689

Open
ohmayr opened this issue Aug 24, 2024 · 0 comments
Open

Set random.seed explicitly in each test function for rest streaming #689

ohmayr opened this issue Aug 24, 2024 · 0 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.

Comments

@ohmayr
Copy link
Contributor

ohmayr commented Aug 24, 2024

Currently, the tests for rest streaming depend on a single seed value configured globally within the file here. This makes the tests non-deterministic and inter-dependent making it difficult to understand and debug test failures.

Instead, we can either:

  • set random.seed explicitly in each test function. The value can either be hard-coded in (recommended), or it can be varying (by passing in, say, an integer based on time of day, PID, etc.) .

or

  • pass in the seed to the constructor of _ResponseItr within the test file.

In either case, make sure the logs and / or errors print out what the value of the seed turned out to be, so that if we encounter the same failure, we can make sure the test function sets the same seed so we can replicate it.

Also do the same for the test cases of asynchronous rest streaming once implemented. See: [async rest]streaming(#686)

Reference: #686 (comment)

@ohmayr ohmayr added type: process A process-related concern. May include testing, release, or the like. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

1 participant