Skip to content

update go-test module#11390

Draft
gammazero wants to merge 16 commits into
masterfrom
update-go-test
Draft

update go-test module#11390
gammazero wants to merge 16 commits into
masterfrom
update-go-test

Conversation

@gammazero

@gammazero gammazero commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🧪 Tests use new go-test and math/rand/v2

The new go-test is upgraded to use math/rand/v2 in all of its packages. The /go-test/random package now allows reuse of the random number generator for more efficiently generating sets of random values.

Additionally, the /go-test/random package removes support for a global seed for the random number generator. This led to the possibility of multiple tests setting the global seed to generate deterministic values, and breaking other tests by causing the generator to generate unexpected values. This breakage could be intermittent and difficult to debug, depending on the how/which tests ran at the same time.

Since the underlying pseudo-random number generator was changed in the go-test module, the data generated for a given seed also changed. This required updating tests that relied on seeding the generator and getting expected values.

  • Use new go-test/random API
    • no global seed values
    • reuse generator where appropriate
  • Fix tests to match new random data generation
    • update expected deterministic values
    • fix t0040-add-and-cat.sh
    • fix t0043-add-w.sh
    • fix t0045-ls.sh
    • fix t0087-repo-robust-gc.sh
    • fix t0270-filestore.sh
    • fix t0271-filestore-utils.sh
    • fix t0272-urlstore.sh
  • Migrate from /math/rand' to /math/rand/v2`
    • random seeds are now [32]byte and not uint64

@socket-security

socket-security Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​ipfs/​go-test@​v0.3.0 ⏵ v0.3.1-0.20260709160526-27b54c53fe50100 +1100100100100

View full report

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