Skip to content

skip random tests on Go 1.25#1652

Merged
SpencerTorres merged 1 commit intomainfrom
skip_random
Sep 12, 2025
Merged

skip random tests on Go 1.25#1652
SpencerTorres merged 1 commit intomainfrom
skip_random

Conversation

@SpencerTorres
Copy link
Copy Markdown
Member

No description provided.

@SpencerTorres SpencerTorres merged commit ea54c0c into main Sep 12, 2025
13 checks passed
Onyx2406 added a commit to Onyx2406/clickhouse-go that referenced this pull request Mar 7, 2026
Migrate all usages of the deprecated math/rand package to math/rand/v2
across the codebase. This fixes the Go 1.25 compatibility issue where
rand.Seed no longer works (ClickHouse#1652).

Key changes:
- Replace math/rand imports with math/rand/v2 in all 19 affected files
- Use rand.IntN instead of rand.Intn (v2 naming convention)
- Replace rand.NewSource with rand.NewPCG for local random generators
- Remove all rand.Seed calls (v2 auto-seeds the global source)
- Fix ConnOpenRandom strategy: pick random offset once outside the
  loop instead of on every iteration, ensuring all addresses are
  tried before failing over
- Re-enable TestConnFailoverRandom and TestStdConnFailoverRandom
  tests that were skipped due to Go 1.25 math/random changes

Fixes ClickHouse#1653
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