Skip to content

Commit

Permalink
Fix flaky test cases in keyspace_test.go (apache#2104)
Browse files Browse the repository at this point in the history
We expired a key with 1 second which is too short for testing the expiration time,
because `Metadata::ExpireMsToS` function will use rounding to get a closer time value if
METADATA_64BIT_ENCODING_MASK was disabled.

This closes apache#2091
  • Loading branch information
git-hulk authored Feb 17, 2024
1 parent 1052bab commit e8c05a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/gocase/unit/keyspace/keyspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func TestKeyspace(t *testing.T) {
})

t.Run("Type a expired key", func(t *testing.T) {
expireTime := time.Second
expireTime := 2 * time.Second
key := "foo"
require.NoError(t, rdb.Del(ctx, key).Err())
require.Equal(t, "OK", rdb.SetEx(ctx, key, "bar", expireTime).Val())
Expand Down

0 comments on commit e8c05a3

Please sign in to comment.