From 7101fcc020d8266a44d9fec2bf8061a8f93e5023 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Wed, 4 Feb 2026 17:26:24 +0200 Subject: [PATCH] Remove checking for expected fragment size in fragment info tests. The precise size of files in storage is an implementation detail that consumers should not be relying on (besides storage format changes, it may be affected by compression library updates). We remove fragment size comparisons with hardoced numbers from the fragment info tests, and replace them by asserting that they are larger than zero. This is not the first time we have done this (TileDB-Inc/TileDB-Cloud-REST#4761), and there's lots of existing test coverage of the fragment info Go APIs. --- fragment_info_test.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fragment_info_test.go b/fragment_info_test.go index 19a784fc..931ed5d8 100644 --- a/fragment_info_test.go +++ b/fragment_info_test.go @@ -16,8 +16,7 @@ func TestFragmentInfo(t *testing.T) { context, err := NewContext(config) require.NoError(t, err) - fragmentSize := testFragmentInfo(t, context) - assert.Equal(t, uint64(4290), fragmentSize) + testFragmentInfo(t, context) } func TestFragmentInfoEncryption(t *testing.T) { @@ -36,11 +35,10 @@ func TestFragmentInfoEncryption(t *testing.T) { context, err := NewContext(config) require.NoError(t, err) - fragmentSize := testFragmentInfo(t, context) - assert.Equal(t, uint64(7601), fragmentSize) + testFragmentInfo(t, context) } -func testFragmentInfo(t testing.TB, context *Context) uint64 { +func testFragmentInfo(t testing.TB, context *Context) { // create temp group name tmpArrayPath := t.TempDir() @@ -91,6 +89,7 @@ func testFragmentInfo(t testing.TB, context *Context) uint64 { fragmentSize, err := fI.GetFragmentSize(0) require.NoError(t, err) + require.Greater(t, fragmentSize, uint64(0)) isDense, err := fI.GetDense(0) require.NoError(t, err) @@ -142,8 +141,6 @@ func testFragmentInfo(t testing.TB, context *Context) uint64 { assert.Contains(t, fragmentInfoStr, fI.uri) fI.Free() - - return fragmentSize } func writeToArray(t testing.TB, context *Context, tmpArrayPath string) {