make sure buckets are shutdown at the end of test
@@ -232,6 +232,11 @@ func TestMemtableFlushesIfIdle(t *testing.T) {
t.Run("assert no segments exist even after passing the idle threshold", func(t *testing.T) {
assert.Equal(t, 0, len(bucket.disk.segments))
})
+
+ t.Run("shutdown bucket", func(t *testing.T) {
+ ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
+ require.Nil(t, bucket.Shutdown(ctx))
+ })
})
t.Run("a dirty memtable is flushed once the idle period is over", func(t *testing.T) {
@@ -266,6 +271,11 @@ func TestMemtableFlushesIfIdle(t *testing.T) {
t.Run("assert that a flush has occurred (and one segment exists)", func(t *testing.T) {
assert.Equal(t, 1, len(bucket.disk.segments))
})
+
+ t.Run("shutdown bucket", func(t *testing.T) {
+ ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
+ require.Nil(t, bucket.Shutdown(ctx))
+ })
})
t.Run("a dirty memtable is not flushed as long as the next write occurs before the idle threshold", func(t *testing.T) {
@@ -317,5 +327,10 @@ func TestMemtableFlushesIfIdle(t *testing.T) {
t.Run("assert that a flush has occurred (and one segment exists)", func(t *testing.T) {
assert.Equal(t, 1, len(bucket.disk.segments))
})
+
+ t.Run("shutdown bucket", func(t *testing.T) {
+ ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
+ require.Nil(t, bucket.Shutdown(ctx))
+ })
})
}
