Skip to content

Commit

Permalink
update 20
Browse files Browse the repository at this point in the history
  • Loading branch information
XuPeng-SH committed Dec 16, 2024
1 parent 50aa918 commit 3001e74
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/vm/engine/tae/db/gc/v3/cleaner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,30 @@ func TestDiskCleaner_WriteToReplay(t *testing.T) {
require.Error(t, err)
require.True(t, moerr.IsMoErrCode(err, moerr.ErrTxnControl))
}

func TestForMockCoverage(t *testing.T) {
var cleaner MockCleaner
ctx := context.Background()
require.NoError(t, cleaner.Replay(ctx))
require.NoError(t, cleaner.Process(ctx))
require.NoError(t, cleaner.TryGC(ctx))
cleaner.AddChecker(nil, "")
require.Nil(t, cleaner.GetChecker(""))
require.Nil(t, cleaner.RemoveChecker(""))
require.Nil(t, cleaner.GetScanWaterMark())
require.Nil(t, cleaner.GetCheckpointGCWaterMark())
require.Nil(t, cleaner.GetScannedWindow())
require.Nil(t, cleaner.GetMinMerged())
require.Nil(t, cleaner.DoCheck())
v1, v2 := cleaner.GetPITRs()
require.Nil(t, v1)
require.Nil(t, v2)
cleaner.GCEnabled()
require.Nil(t, cleaner.GetMPool())
v3, v4 := cleaner.GetSnapshots()
require.Nil(t, v3)
require.Nil(t, v4)
require.Equal(t, "", cleaner.GetTablePK(0))

require.NoError(t, cleaner.Close())
}
1 change: 1 addition & 0 deletions pkg/vm/engine/tae/db/test/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10537,6 +10537,7 @@ func Test_BasicTxnModeSwitch(t *testing.T) {
func Test_OpenReplayDB1(t *testing.T) {
ctx := context.Background()
opts := config.WithLongScanAndCKPOpts(nil)
opts.CheckpointCfg.MetadataCheckInterval = time.Millisecond * 2
tae := testutil.NewReplayTestEngine(ctx, ModuleName, t, opts)
defer tae.Close()
assert.True(t, tae.IsReplayMode())
Expand Down

0 comments on commit 3001e74

Please sign in to comment.