@@ -27,6 +27,7 @@ import (
2727 "github.com/cockroachdb/pebble/internal/base"
2828 "github.com/cockroachdb/pebble/internal/buildtags"
2929 "github.com/cockroachdb/pebble/internal/cache"
30+ "github.com/cockroachdb/pebble/internal/compact"
3031 "github.com/cockroachdb/pebble/internal/testkeys"
3132 "github.com/cockroachdb/pebble/internal/testutils"
3233 "github.com/cockroachdb/pebble/objstorage/objstorageprovider"
@@ -306,10 +307,16 @@ func TestBasicWrites(t *testing.T) {
306307}
307308
308309func TestRandomWrites (t * testing.T ) {
309- d , err := Open ( "" , testingRandomized ( t , & Options {
310+ opts := & Options {
310311 FS : vfs .NewMem (),
311312 MemTableSize : 8 * 1024 ,
312- }))
313+ }
314+ opts .Experimental .LatencyTolerantSpanPolicy = func () compact.ValueSeparationOutputConfig {
315+ return compact.ValueSeparationOutputConfig {
316+ MinimumSize : 10 ,
317+ }
318+ }
319+ d , err := Open ("" , testingRandomized (t , opts ))
313320 require .NoError (t , err )
314321
315322 keys := [64 ][]byte {}
@@ -697,10 +704,16 @@ func TestIterLeak(t *testing.T) {
697704 for _ , flush := range []bool {true , false } {
698705 t .Run (fmt .Sprintf ("flush=%t" , flush ), func (t * testing.T ) {
699706 fc := NewFileCache (10 , 100 )
700- d , err := Open ( "" , testingRandomized ( t , & Options {
707+ opts := & Options {
701708 FS : vfs .NewMem (),
702709 FileCache : fc ,
703- }))
710+ }
711+ opts .Experimental .LatencyTolerantSpanPolicy = func () compact.ValueSeparationOutputConfig {
712+ return compact.ValueSeparationOutputConfig {
713+ MinimumSize : 10 ,
714+ }
715+ }
716+ d , err := Open ("" , testingRandomized (t , opts ))
704717 require .NoError (t , err )
705718
706719 require .NoError (t , d .Set ([]byte ("a" ), []byte ("a" ), nil ))
@@ -1194,6 +1207,11 @@ func TestDBConcurrentCompactClose(t *testing.T) {
11941207 return 1 , 2
11951208 },
11961209 }
1210+ opts .Experimental .LatencyTolerantSpanPolicy = func () compact.ValueSeparationOutputConfig {
1211+ return compact.ValueSeparationOutputConfig {
1212+ MinimumSize : 10 ,
1213+ }
1214+ }
11971215 d , err := Open ("" , testingRandomized (t , opts ))
11981216 require .NoError (t , err )
11991217
@@ -1265,7 +1283,13 @@ func TestDBApplyBatchMismatch(t *testing.T) {
12651283func TestCloseCleanerRace (t * testing.T ) {
12661284 mem := vfs .NewMem ()
12671285 for i := 0 ; i < 20 ; i ++ {
1268- db , err := Open ("" , testingRandomized (t , & Options {FS : mem }))
1286+ opts := & Options {FS : mem }
1287+ opts .Experimental .LatencyTolerantSpanPolicy = func () compact.ValueSeparationOutputConfig {
1288+ return compact.ValueSeparationOutputConfig {
1289+ MinimumSize : 10 ,
1290+ }
1291+ }
1292+ db , err := Open ("" , testingRandomized (t , opts ))
12691293 require .NoError (t , err )
12701294 require .NoError (t , db .Set ([]byte ("a" ), []byte ("something" ), Sync ))
12711295 require .NoError (t , db .Flush ())
0 commit comments