mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-29 23:15:28 +08:00
issue: #33285 - add adaptor to implement walimpls into wal interface. - implement timetick sorted and filtering scanner. - add test for wal. --------- Signed-off-by: chyezh <chyezh@outlook.com>
26 lines
549 B
Go
26 lines
549 B
Go
package utility
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/milvus-io/milvus/pkg/mocks/streaming/util/mock_message"
|
|
"github.com/milvus-io/milvus/pkg/streaming/util/message"
|
|
)
|
|
|
|
func TestImmutableMessageQueue(t *testing.T) {
|
|
q := NewImmutableMessageQueue()
|
|
for i := 0; i < 100; i++ {
|
|
q.Add([]message.ImmutableMessage{
|
|
mock_message.NewMockImmutableMessage(t),
|
|
})
|
|
assert.Equal(t, i+1, q.Len())
|
|
}
|
|
for i := 100; i > 0; i-- {
|
|
assert.NotNil(t, q.Next())
|
|
q.UnsafeAdvance()
|
|
assert.Equal(t, i-1, q.Len())
|
|
}
|
|
}
|