Skip to content

Commit

Permalink
db: fix flaky TestLatestRefCounting
Browse files Browse the repository at this point in the history
This check is racy in both directions:
 - we can check "too early", in that an asynchronous
   `collectTableStats` might still be holding a reference
 - we can check "too late", in that cleanup of the obsolete table has
   already happened

Since object cleanup is not the main point of this test, this commit
removes this check altogether.

Fixes #3043
  • Loading branch information
RaduBerinde committed Dec 7, 2023
1 parent b3f359e commit dbeb058
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions version_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,6 @@ func TestLatestRefCounting(t *testing.T) {
require.False(t, ok)
require.Equal(t, 0, int(m2.FileBacking.VirtualizedSize.Load()))
checkBackingSize(t, d)

// Make sure that the backing file is added to the obsolete tables list.
require.Equal(t, 1, len(d.mu.versions.obsoleteTables))

}

// TODO(bananabrick): Convert TestLatestRefCounting and this test into a single
Expand Down

0 comments on commit dbeb058

Please sign in to comment.