test: restore skipped test for pipelined dml (#1238)

* test: restore skipped test

Signed-off-by: ekexium <eke@fastmail.com>

* test: FlushWait() to avoid race

Signed-off-by: ekexium <eke@fastmail.com>

---------

Signed-off-by: ekexium <eke@fastmail.com>
This commit is contained in:
ekexium 2024-03-19 20:37:44 +08:00 committed by GitHub
parent c9767e5558
commit 58ef395164
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -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.

View File

@ -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)`))
@ -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)`))