Skip to content

Commit

Permalink
test: restore skipped test for pipelined dml (#1238)
Browse files Browse the repository at this point in the history
* test: restore skipped test

Signed-off-by: ekexium <[email protected]>

* test: FlushWait() to avoid race

Signed-off-by: ekexium <[email protected]>

---------

Signed-off-by: ekexium <[email protected]>
  • Loading branch information
ekexium authored Mar 19, 2024
1 parent c9767e5 commit 58ef395
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 4 additions & 5 deletions integration_tests/pipelined_memdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,10 @@ func (s *testPipelinedMemDBSuite) TestPipelinedPrefetch() {
s.Nil(txn.GetMemBuffer().FlushWait())
m, err = txn.BatchGet(context.Background(), [][]byte{[]byte("99")})
s.Nil(err)
// restore this check after tikv return pairs for buffer batch get
//s.Equal(m, map[string][]byte{})
//v, err = panicWhenReadingRemoteBuffer([]byte("99"))
//s.Nil(err)
//s.Equal(v, []byte{})
s.Equal(m, map[string][]byte{})
v, err = panicWhenReadingRemoteBuffer([]byte("99"))
s.Nil(err)
s.Equal(v, []byte{})
txn.Rollback()

// empty memdb should also cache the not exist result.
Expand Down
2 changes: 2 additions & 0 deletions internal/unionstore/pipelined_memdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ func TestPipelinedAdjustFlushCondition(t *testing.T) {
flushed, err = memdb.Flush(false)
require.Nil(t, err)
require.True(t, flushed)
require.Nil(t, memdb.FlushWait())

// need 2 keys to flush
require.Nil(t, failpoint.Enable("tikvclient/pipelinedMemDBMinFlushKeys", `return(2)`))
Expand All @@ -332,6 +333,7 @@ func TestPipelinedAdjustFlushCondition(t *testing.T) {
flushed, err = memdb.Flush(false)
require.Nil(t, err)
require.False(t, flushed)
require.Nil(t, memdb.FlushWait())

// need 2 keys to flush, but force threshold reached
require.Nil(t, failpoint.Enable("tikvclient/pipelinedMemDBMinFlushKeys", `return(2)`))
Expand Down

0 comments on commit 58ef395

Please sign in to comment.