From 69a3ba5b33233c40dac9341a0e7c25cb57db8eb5 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 15 Jun 2026 21:47:31 +0200 Subject: [PATCH] index: speed up oversized test data generation --- internal/repository/index/index_internal_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/repository/index/index_internal_test.go b/internal/repository/index/index_internal_test.go index 94a871ed3..c5cf2c6e6 100644 --- a/internal/repository/index/index_internal_test.go +++ b/internal/repository/index/index_internal_test.go @@ -13,11 +13,18 @@ func TestIndexOversized(t *testing.T) { // Add blobs up to indexMaxBlobs + pack.MaxHeaderEntries - 1 packID := idx.addToPacks(restic.NewRandomID()) + id := restic.NewRandomID() for i := uint(0); i < indexMaxBlobs+pack.MaxHeaderEntries-1; i++ { + // Directly modify ID to avoid benchmarking NewRandomID + id[0] = byte(i) + id[1] = byte(i >> 8) + id[2] = byte(i >> 16) + id[3] = byte(i >> 24) + idx.store(packID, pack.Blob{ BlobHandle: restic.BlobHandle{ Type: restic.DataBlob, - ID: restic.NewRandomID(), + ID: id, }, Length: 100, Offset: uint(i) * 100,