Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
rabunkosar-dd committed Jan 21, 2025
1 parent 006d9ce commit 65cb29b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/gocase/unit/info/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import (
"testing"
"time"

"github.com/redis/go-redis/v9"

"github.com/apache/kvrocks/tests/gocase/util"
"github.com/redis/go-redis/v9"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -108,20 +107,17 @@ func TestInfo(t *testing.T) {
})

t.Run("get command latencies via histogram INFO - histogram-bucket-boundaries", func(t *testing.T) {
output := util.FindInfoEntry(rdb0, "cmdstathist", "cmdstathist_info")
if len(output) == 0 {
t.SkipNow()
}
output := util.FindInfoEntry(rdb0, "cmdstathist_info", "commandstats")

splitValues := strings.FieldsFunc(output, func(r rune) bool {
return r == '=' || r == ','
})

// expected: 10=..,20=..,30=..,50=..,inf=..,sum=...,count=..
require.GreaterOrEqual(t, len(splitValues), 15)
require.GreaterOrEqual(t, len(splitValues), 14)
require.Contains(t, splitValues, "sum")
require.Contains(t, splitValues, "count")
require.Contains(t, splitValues, "info")
require.Contains(t, splitValues, "inf")
})
}

Expand Down

0 comments on commit 65cb29b

Please sign in to comment.