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

test(Misc): Deterministic mode of tests #3899

Closed
Tracked by #5070
benesjan opened this issue Jan 9, 2024 · 0 comments · Fixed by #5155
Closed
Tracked by #5070

test(Misc): Deterministic mode of tests #3899

benesjan opened this issue Jan 9, 2024 · 0 comments · Fixed by #5155
Assignees

Comments

@benesjan
Copy link
Contributor

benesjan commented Jan 9, 2024

For debugging it's useful to have tests deterministic (typically when some hashes are messed up or you want to compare your broken branch with master). We currently don't support that and I think we could achieve it by modifyingFr.random(), GrumpkinScalar.random() functions such that they use a central source of "randomness" and this source could be a pseudorandom generator with some seed. If a SEED env variable would be set this pseudorandom generator would be used with the given seed instead of the truly random numbers.

@github-project-automation github-project-automation bot moved this to Todo in A3 Jan 9, 2024
@benesjan benesjan changed the title Allow for making the tests deterministic Deterministic tests Jan 9, 2024
@benesjan benesjan changed the title Deterministic tests Deterministic mode of tests Jan 9, 2024
@benesjan benesjan assigned benesjan and unassigned benesjan Jan 9, 2024
@benesjan benesjan self-assigned this Mar 12, 2024
benesjan added a commit that referenced this issue Mar 12, 2024
Fixes #3899

When exporting SEED=[number] env var deterministic mode gets used now.
Note that there are other sources of info in some tests so the results
might not be the same in all the cases. E.g. in integration l1 publisher
test the second block has a populated timestamp and therefore will have
different archive root. For first block the timestamp is set to 0 so
there an equal result should be achieved.
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Mar 12, 2024
@LHerskind LHerskind changed the title Deterministic mode of tests test(Misc): Deterministic mode of tests Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant