diff --git a/weed/s3api/s3api_object_handlers_copy_test.go b/weed/s3api/s3api_object_handlers_copy_test.go index 733a146aa..018c9f270 100644 --- a/weed/s3api/s3api_object_handlers_copy_test.go +++ b/weed/s3api/s3api_object_handlers_copy_test.go @@ -546,6 +546,11 @@ func TestCleanupVersioningMetadata(t *testing.T) { t.Errorf("Expected key %s to be removed from destination metadata, but it's still present", key) } } + + // Verify the count matches to ensure no extra keys are present + if len(dstMetadata) != len(tc.expectedKeys) { + t.Errorf("Expected %d metadata keys, but got %d. Extra keys might be present.", len(tc.expectedKeys), len(dstMetadata)) + } }) } }