diff --git a/internal/repository/repack_test.go b/internal/repository/repack_test.go index 72eb9d3dd..458362c59 100644 --- a/internal/repository/repack_test.go +++ b/internal/repository/repack_test.go @@ -16,7 +16,7 @@ func randomSize(min, max int) int { } func random(t testing.TB, length int) []byte { - rd := restic.NewRandReader(rand.New(rand.NewSource(int64(length)))) + rd := restic.NewRandReader(rand.New(rand.NewSource(rand.Int63()))) buf := make([]byte, length) _, err := io.ReadFull(rd, buf) if err != nil { @@ -189,6 +189,10 @@ func TestRepack(t *testing.T) { repo, cleanup := repository.TestRepository(t) defer cleanup() + seed := rand.Int63() + rand.Seed(seed) + t.Logf("rand seed is %v", seed) + createRandomBlobs(t, repo, 100, 0.7) packsBefore := listPacks(t, repo)