Skip to content

fix: update go-test module#11390

Open
gammazero wants to merge 15 commits into
masterfrom
update-go-test
Open

fix: update go-test module#11390
gammazero wants to merge 15 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
    • use StringToSeed or Uint64ToSeed to create random seeds for deterministic output

@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/​boxo@​v0.41.1-0.20260707130650-177b35c8ef09 ⏵ v0.41.1-0.20260714175209-5ecaf9b4bcda74 +1100100100100
Updatedgithub.com/​ipfs/​go-test@​v0.3.0 ⏵ v0.4.0100 +1100100100100

View full report

@gammazero gammazero marked this pull request as ready for review July 13, 2026 19:34
@gammazero gammazero requested a review from a team as a code owner July 13, 2026 19:34
lidel added 2 commits July 14, 2026 20:08
Picks up the chunker gen and gateway race fixes on the boxo go-test
branch.
The findprovs entry was listed after pubsub in the table of contents
but comes before it in the document.
@lidel lidel changed the title update go-test module refactor: update go-test module Jul 14, 2026
@lidel lidel changed the title refactor: update go-test module fix: update go-test module Jul 14, 2026

@lidel lidel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @gammazero, the pin is still a commit on the boxo branch, so once ipfs/boxo#1187 lands, re-pin to boxo main and go ahead and merge, no need to wait on me.

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.

2 participants