From 3c559dc2948112de51c5a59ae52a4bc18244d7a4 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 16 Mar 2024 23:48:31 -0700 Subject: [PATCH] fix test2 --- weed/util/log_buffer/log_buffer_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/weed/util/log_buffer/log_buffer_test.go b/weed/util/log_buffer/log_buffer_test.go index ac46a096c..84279f625 100644 --- a/weed/util/log_buffer/log_buffer_test.go +++ b/weed/util/log_buffer/log_buffer_test.go @@ -13,12 +13,12 @@ import ( func TestNewLogBufferFirstBuffer(t *testing.T) { flushInterval := time.Second - lb := NewLogBuffer("test", flushInterval, func(startTime, stopTime time.Time, buf []byte) { + lb := NewLogBuffer("test", flushInterval, func(logBuffer *LogBuffer, startTime time.Time, stopTime time.Time, buf []byte) { fmt.Printf("flush from %v to %v %d bytes\n", startTime, stopTime, len(buf)) }, nil, func() { }) - startTime := time.Now() + startTime := MessagePosition{Time:time.Now()} messageSize := 1024 messageCount := 5000 @@ -31,13 +31,13 @@ func TestNewLogBufferFirstBuffer(t *testing.T) { lastProcessedTime, isDone, err := lb.LoopProcessLogData("test", startTime, 0, func() bool { // stop if no more messages return receivedMessageCount < messageCount - }, func(logEntry *filer_pb.LogEntry) error { + }, func(logEntry *filer_pb.LogEntry) (isDone bool, err error) { receivedMessageCount++ if receivedMessageCount >= messageCount { println("processed all messages") - return io.EOF + return true, io.EOF } - return nil + return false,nil }) fmt.Printf("before flush: sent %d received %d\n", messageCount, receivedMessageCount)