Skip to content

Conversation

Rexicon226
Copy link
Contributor

It's preferred to use the random seed provided by the stdlib (which changes every run, but is deterministic, and can be passed into the test runner again to reproduce identical results), instead of just hardcoding a single number. This ensures the unit doesn't have some hidden dependence on the seed of the prng used.

Had to fix a couple cases just like this, where we would hardcode expected results which depend on the seed to the prng. The change makes it clearer what inputs are used to get said output.

Almost the entire diff is just that, maybe a few little fixes in random places.

@github-project-automation github-project-automation bot moved this to 🏗 In progress in Sig Oct 4, 2025
@Rexicon226 Rexicon226 force-pushed the Rexicon226/random-seed branch from c189c0a to 677c7ca Compare October 4, 2025 20:54
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/accountsdb/db.zig 88.91% <100.00%> (ø)
src/accountsdb/manager.zig 97.09% <100.00%> (ø)
src/accountsdb/snapshot/download.zig 56.46% <100.00%> (ø)
src/accountsdb/swiss_map.zig 97.04% <100.00%> (ø)
src/consensus/fork_choice.zig 98.12% <100.00%> (ø)
src/consensus/latest_validator_votes.zig 95.37% <100.00%> (ø)
src/consensus/replay_tower.zig 93.73% <100.00%> (ø)
src/consensus/vote_listener.zig 92.31% <100.00%> (ø)
src/consensus/vote_tracker.zig 73.85% <100.00%> (ø)
src/core/blockhash_queue.zig 100.00% <100.00%> (ø)
... and 72 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

1 participant