Skip to content

Commit 1ed6227

Browse files
committed
fix chunk data packs tests
1 parent bbbad00 commit 1ed6227

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

storage/store/chunk_data_packs_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,22 @@ func TestChunkDataPacks_BatchRemoveChunkDataPacksOnly(t *testing.T) {
172172

173173
// Prepare chunk IDs for removal
174174
chunkIDs := make([]flow.Identifier, len(chunkDataPacks))
175+
chunkDataPackIDs := make([]flow.Identifier, len(chunkDataPacks))
175176
for i, chunkDataPack := range chunkDataPacks {
176177
chunkIDs[i] = chunkDataPack.ChunkID
178+
chunkDataPackIDs = append(chunkDataPackIDs, chunkDataPack.ID())
177179
}
178180

179181
// Test BatchRemoveChunkDataPacksOnly - verify it can be called without error
180182
require.NoError(t, chunkDataPackDB.WithReaderBatchWriter(func(chunkDataPackDBBatch storage.ReaderBatchWriter) error {
181183
return chunkDataPackStore.BatchRemoveChunkDataPacksOnly(chunkIDs, chunkDataPackDBBatch)
182184
}))
183185

184-
// Note: The exact behavior after removal may depend on caching and implementation details
185-
// The main test is that the method can be called without error
186+
// Verify the chunk data packs have been removed from chunk data pack DB
187+
for _, id := range chunkDataPackIDs {
188+
_, err := stored.ByID(id)
189+
assert.ErrorIs(t, err, storage.ErrNotFound)
190+
}
186191
})
187192
})
188193
}

0 commit comments

Comments
 (0)