Skip to content

Commit e674388

Browse files
authored
FIX: resolve Valkey 9 compatibility issues across all clients (valkey-io#4632)
* FIX: resolve Valkey 9 compatibility issues across all clients - Update LOLWUT tests to support both Redis and Valkey version formats using regex patterns - Fix hash field expiration commands in Java Jedis layer with proper FIELDS keyword and count - Maintain backward compatibility while supporting Valkey 9 server responses - Update test assertions in Go, Java, Node.js, and Python clients Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> * changelog update Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> * fix java and python tests Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> * java: Fix hash field expiration commands and Valkey 9 compatibility - Add missing FIELDS keyword and numfields count to all hash field expiration commands in Jedis compatibility layer - Update HGETDEL test version requirements to Valkey 9.0.0+ - Fix HPERSIST test expectation to return -1 for fields without expiration - Update objectEncoding tests to accept both 'embstr' and 'raw' encodings for Valkey 9.0.0+ compatibility - Improve test version checks and comments for hash field expiration command availability Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> * updated the changelog Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> * removed regex and simplified lolwut check Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> * simplified test on battestutilities.java Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> * Revert "simplified test on battestutilities.java" This reverts commit 64f53dd. Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com> --------- Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>
1 parent a4d38b1 commit e674388

File tree

16 files changed

+351
-74
lines changed

16 files changed

+351
-74
lines changed

.github/json_matrices/engine-matrix.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"type": "valkey",
4+
"version": "9.0.0-rc1",
5+
"run": "always"
6+
},
27
{
38
"type": "valkey",
49
"version": "8.1",

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
* Java: Add lazy connection support to Java module ([#4350](https://github.com/valkey-io/valkey-glide/pull/4370))
88
* Go: Add lazy connection support ([#4374](https://github.com/valkey-io/valkey-glide/pull/4374))
9+
* Java/Go/Node/Python: Fixed LOLWUT tests and Jedis compatibility layer tests for Valkey 9 ([#4632](https://github.com/valkey-io/valkey-glide/pull/4632))
910
* Core/Python: fix 100% CPU when blocking command returning data after client closure ([#4612](https://github.com/valkey-io/valkey-glide/pull/4612))
1011

1112
#### Operational Enhancements

go/integTest/cluster_commands_test.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,11 @@ func (suite *GlideTestSuite) TestClusterLolwut() {
11481148
result, err := client.Lolwut(context.Background())
11491149
suite.NoError(err)
11501150
suite.NotEmpty(result)
1151-
suite.Contains(result, "Redis ver.")
1151+
// Check for version string in LOLWUT output (dual contains approach)
1152+
hasVer := strings.Contains(result, "ver")
1153+
hasVersion := strings.Contains(result, suite.serverVersion)
1154+
suite.True(hasVer && hasVersion,
1155+
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, result)
11521156
}
11531157

11541158
func (suite *GlideTestSuite) TestLolwutWithOptions_WithAllNodes() {
@@ -1167,7 +1171,11 @@ func (suite *GlideTestSuite) TestLolwutWithOptions_WithAllNodes() {
11671171
multiValue := result.MultiValue()
11681172

11691173
for _, value := range multiValue {
1170-
suite.Contains(value, "Redis ver.")
1174+
// Check for version string in LOLWUT output (dual contains approach)
1175+
hasVer := strings.Contains(value, "ver")
1176+
hasVersion := strings.Contains(value, suite.serverVersion)
1177+
assert.True(suite.T(), hasVer && hasVersion,
1178+
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, value)
11711179
}
11721180
}
11731181

@@ -1186,7 +1194,11 @@ func (suite *GlideTestSuite) TestLolwutWithOptions_WithAllPrimaries() {
11861194
multiValue := result.MultiValue()
11871195

11881196
for _, value := range multiValue {
1189-
assert.Contains(suite.T(), value, "Redis ver.")
1197+
// Check for version string in LOLWUT output (dual contains approach)
1198+
hasVer := strings.Contains(value, "ver")
1199+
hasVersion := strings.Contains(value, suite.serverVersion)
1200+
assert.True(suite.T(), hasVer && hasVersion,
1201+
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, value)
11901202
}
11911203
}
11921204

@@ -1203,7 +1215,11 @@ func (suite *GlideTestSuite) TestLolwutWithOptions_WithRandomRoute() {
12031215

12041216
assert.True(suite.T(), result.IsSingleValue())
12051217
singleValue := result.SingleValue()
1206-
assert.Contains(suite.T(), singleValue, "Redis ver.")
1218+
// Check for version string in LOLWUT output (dual contains approach)
1219+
hasVer := strings.Contains(singleValue, "ver")
1220+
hasVersion := strings.Contains(singleValue, suite.serverVersion)
1221+
assert.True(suite.T(), hasVer && hasVersion,
1222+
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, singleValue)
12071223
}
12081224

12091225
func (suite *GlideTestSuite) TestClientIdCluster() {

go/integTest/standalone_commands_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -783,23 +783,35 @@ func (suite *GlideTestSuite) TestLolwutWithOptions_WithVersion() {
783783
options := options.NewLolwutOptions(8)
784784
res, err := client.LolwutWithOptions(context.Background(), *options)
785785
assert.NoError(suite.T(), err)
786-
assert.Contains(suite.T(), res, "Redis ver.")
786+
// Check for version string in LOLWUT output (dual contains approach)
787+
hasVer := strings.Contains(res, "ver")
788+
hasVersion := strings.Contains(res, suite.serverVersion)
789+
assert.True(suite.T(), hasVer && hasVersion,
790+
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, res)
787791
}
788792

789793
func (suite *GlideTestSuite) TestLolwutWithOptions_WithVersionAndArgs() {
790794
client := suite.defaultClient()
791795
opts := options.NewLolwutOptions(8).SetArgs([]int{10, 20})
792796
res, err := client.LolwutWithOptions(context.Background(), *opts)
793797
assert.NoError(suite.T(), err)
794-
assert.Contains(suite.T(), res, "Redis ver.")
798+
// Check for version string in LOLWUT output (dual contains approach)
799+
hasVer := strings.Contains(res, "ver")
800+
hasVersion := strings.Contains(res, suite.serverVersion)
801+
assert.True(suite.T(), hasVer && hasVersion,
802+
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, res)
795803
}
796804

797805
func (suite *GlideTestSuite) TestLolwutWithOptions_EmptyArgs() {
798806
client := suite.defaultClient()
799807
opts := options.NewLolwutOptions(6).SetArgs([]int{})
800808
res, err := client.LolwutWithOptions(context.Background(), *opts)
801809
assert.NoError(suite.T(), err)
802-
assert.Contains(suite.T(), res, "Redis ver.")
810+
// Check for version string in LOLWUT output (dual contains approach)
811+
hasVer := strings.Contains(res, "ver")
812+
hasVersion := strings.Contains(res, suite.serverVersion)
813+
assert.True(suite.T(), hasVer && hasVersion,
814+
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, res)
803815
}
804816

805817
func (suite *GlideTestSuite) TestClientId() {

0 commit comments

Comments
 (0)