Skip to content

Commit

Permalink
fix: temporary fix apache#2473
Browse files Browse the repository at this point in the history
  • Loading branch information
PokIsemaine committed Aug 7, 2024
1 parent 38dfc04 commit 197cb41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/gocase/unit/protocol/regression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"context"
"fmt"
"testing"
"time"

"github.com/apache/kvrocks/tests/gocase/util"
"github.com/stretchr/testify/require"
Expand All @@ -41,7 +42,8 @@ func TestRegression(t *testing.T) {

proto := "*3\r\n$5\r\nBLPOP\r\n$6\r\nhandle\r\n$1\r\n0\r\n"
require.NoError(t, c.Write(fmt.Sprintf("%s%s", proto, proto)))

// TODO: Remove time.Sleep after fix issue #2473
time.Sleep(100 * time.Millisecond)
resList := []string{"*2", "$6", "handle", "$1", "a"}

v := rdb.RPush(ctx, "handle", "a")
Expand Down
1 change: 1 addition & 0 deletions tests/gocase/unit/type/list/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ func TestList(t *testing.T) {
rd := srv.NewTCPClient()
defer func() { require.NoError(t, rd.Close()) }()
createList("blist", []string{"a", "b", large, "c", "d"})
// TODO: Remove time.Sleep after fix issue #2473
time.Sleep(100 * time.Millisecond)
require.NoError(t, rd.WriteArgs("blpop", "blist", "1"))
time.Sleep(100 * time.Millisecond)
Expand Down
1 change: 1 addition & 0 deletions tests/gocase/unit/type/zset/zset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func basicTests(t *testing.T, rdb *redis.Client, ctx context.Context, enabledRES
rdb.ZAdd(ctx, "zsetb", redis.Z{Score: 1, Member: "d"}, redis.Z{Score: 2, Member: "e"})
require.EqualValues(t, 3, rdb.ZCard(ctx, "zseta").Val())
require.EqualValues(t, 2, rdb.ZCard(ctx, "zsetb").Val())
// TODO: Remove time.Sleep after fix issue #2473
time.Sleep(time.Millisecond * 100)
resultz := rdb.BZPopMin(ctx, 0, "zseta", "zsetb").Val().Z
require.Equal(t, redis.Z{Score: 1, Member: "a"}, resultz)
Expand Down

0 comments on commit 197cb41

Please sign in to comment.