mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 09:08:43 +08:00
fix: write ahead buffer unittest failure (#45978)
issue: #45977 Signed-off-by: chyezh <chyezh@outlook.com>
This commit is contained in:
parent
f62297db92
commit
10a781d22c
@ -98,6 +98,7 @@ func (w *WriteAheadBuffer) ReadFromExclusiveTimeTick(ctx context.Context, timeti
|
||||
}
|
||||
return &WriteAheadBufferReader{
|
||||
nextOffset: nextOffset,
|
||||
lastTimeTick: timetick,
|
||||
snapshot: snapshot,
|
||||
underlyingBuf: w,
|
||||
}, nil
|
||||
|
||||
@ -104,6 +104,9 @@ func TestWriteAheadBuffer(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}()
|
||||
if rand.Int31n(2) == 0 {
|
||||
time.Sleep(20 * time.Millisecond)
|
||||
}
|
||||
r1, err := wb.ReadFromExclusiveTimeTick(context.Background(), 1)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, r1)
|
||||
@ -130,7 +133,7 @@ func TestWriteAheadBuffer(t *testing.T) {
|
||||
|
||||
// Read from half of the timetick
|
||||
<-ch
|
||||
assert.Equal(t, totalCnt, len(timeticks))
|
||||
assert.Equal(t, totalCnt, len(timeticks)+1)
|
||||
|
||||
targetTimeTickIdx := len(timeticks) / 2
|
||||
for targetTimeTickIdx < len(timeticks) && timeticks[targetTimeTickIdx+1] == timeticks[targetTimeTickIdx] {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user