Skip to content

Commit

Permalink
Fix internal entry size test (#761)
Browse files Browse the repository at this point in the history
The test meant to assert that the size of entry does not grow beyond
what it is today. 48 is the current size in bytes on x64. On 32-bit
platform that value should be less. As written the test was doing the
opposite comparison.

Fixes #760
  • Loading branch information
pelletier committed Apr 24, 2022
1 parent adacebd commit 5aaf5ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/tracker/seen_test.go
Expand Up @@ -11,5 +11,6 @@ func TestEntrySize(t *testing.T) {
// Validate no regression on the size of entry{}. This is a critical bit for
// performance of unmarshaling documents. Should only be increased with care
// and a very good reason.
require.LessOrEqual(t, 48, int(unsafe.Sizeof(entry{})))
maxExpectedEntrySize := 48
require.LessOrEqual(t, int(unsafe.Sizeof(entry{})), maxExpectedEntrySize)
}

0 comments on commit 5aaf5ef

Please sign in to comment.