Skip to content

Commit

Permalink
Fix flaky test case in Go unit/type/list.go (#1449)
Browse files Browse the repository at this point in the history
Currently, we use the list key 'l' in multiple test cases and they may interact with each other. So we fix it by using a dedicated key for each test case.

For failure logs can see: https://github.com/apache/incubator-kvrocks/actions/runs/5014908898/jobs/8991680649#step:12:104
  • Loading branch information
git-hulk authored May 19, 2023
1 parent 62a0d1b commit fb0e3d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/gocase/unit/type/list/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ func TestZipList(t *testing.T) {

t.Run("ziplist implementation: value encoding and backlink", func(t *testing.T) {
iterations := 100
key := "l"
for j := 0; j < iterations; j++ {
key := fmt.Sprintf("l1-%d", j)
require.NoError(t, rdb.Del(ctx, key).Err())
var lis []string
for i := 0; i < 200; i++ {
Expand Down Expand Up @@ -212,8 +212,8 @@ func TestZipList(t *testing.T) {
})

t.Run("ziplist implementation: encoding stress testing", func(t *testing.T) {
key := "l"
for j := 0; j < 200; j++ {
key := fmt.Sprintf("l2-%d", j)
require.NoError(t, rdb.Del(ctx, key).Err())
var lis []string
l := int(rand.Int63n(400))
Expand Down

0 comments on commit fb0e3d4

Please sign in to comment.