@@ -468,7 +468,7 @@ func TestL1Stall(t *testing.T) {
468
468
db .lc .levels [1 ].totalSize = 100
469
469
go func () {
470
470
tab := createEmptyTable (db )
471
- db .lc .addLevel0Table (tab )
471
+ require . NoError ( t , db .lc .addLevel0Table (tab ) )
472
472
tab .DecrRef ()
473
473
done <- true
474
474
}()
@@ -499,24 +499,12 @@ func createEmptyTable(db *DB) *table.Table {
499
499
b := table .NewTableBuilder (opts )
500
500
// Add one key so that we can open this table.
501
501
b .Add (y .KeyWithTs ([]byte ("foo" ), 1 ), y.ValueStruct {}, 0 )
502
- fd , err := y .CreateSyncedFile (table .NewFilename (db .lc .reserveFileID (), db .opt .Dir ), true )
503
- if err != nil {
504
- panic (err )
505
- }
506
502
507
- if _ , err := fd .Write (b .Finish ()); err != nil {
508
- panic (err )
509
- }
510
- tab , err := table .OpenTable (fd , table.Options {})
503
+ // Open table in memory to avoid adding changes to manifest file.
504
+ tab , err := table .OpenInMemoryTable (b .Finish (), db .lc .reserveFileID (), & opts )
511
505
if err != nil {
512
506
panic (err )
513
507
}
514
- // Add dummy entry to manifest file so that it doesn't complain during compaction.
515
- if err := db .manifest .addChanges ([]* pb.ManifestChange {
516
- newCreateChange (tab .ID (), 0 , 0 , tab .CompressionType ()),
517
- }); err != nil {
518
- panic (err )
519
- }
520
508
521
509
return tab
522
510
}
@@ -537,7 +525,7 @@ func TestL0Stall(t *testing.T) {
537
525
538
526
go func () {
539
527
tab := createEmptyTable (db )
540
- db .lc .addLevel0Table (tab )
528
+ require . NoError ( t , db .lc .addLevel0Table (tab ) )
541
529
tab .DecrRef ()
542
530
done <- true
543
531
}()
0 commit comments