Skip to content

Commit d9eeed1

Browse files
authored
Fix Flaky Test: should handle FTAggregate with Unstable RESP3 Search Module and without stability (#3135)
1 parent e99abe4 commit d9eeed1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ require (
1010
)
1111

1212
retract (
13-
v9.5.3 // This version was accidentally released. Please use version 9.6.0 instead.
1413
v9.5.4 // This version was accidentally released. Please use version 9.6.0 instead.
14+
v9.5.3 // This version was accidentally released. Please use version 9.6.0 instead.
1515
)

search_test.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -1446,16 +1446,18 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
14461446

14471447
options := &redis.FTAggregateOptions{Apply: []redis.FTAggregateApply{{Field: "@CreatedDateTimeUTC * 10", As: "CreatedDateTimeUTC"}}}
14481448
res, err := client.FTAggregateWithArgs(ctx, "idx1", "*", options).RawResult()
1449-
rawVal := client.FTAggregateWithArgs(ctx, "idx1", "*", options).RawVal()
1450-
1451-
Expect(err).NotTo(HaveOccurred())
1452-
Expect(rawVal).To(BeEquivalentTo(res))
14531449
results := res.(map[interface{}]interface{})["results"].([]interface{})
14541450
Expect(results[0].(map[interface{}]interface{})["extra_attributes"].(map[interface{}]interface{})["CreatedDateTimeUTC"]).
14551451
To(Or(BeEquivalentTo("6373878785249699840"), BeEquivalentTo("6373878758592700416")))
14561452
Expect(results[1].(map[interface{}]interface{})["extra_attributes"].(map[interface{}]interface{})["CreatedDateTimeUTC"]).
14571453
To(Or(BeEquivalentTo("6373878785249699840"), BeEquivalentTo("6373878758592700416")))
14581454

1455+
rawVal := client.FTAggregateWithArgs(ctx, "idx1", "*", options).RawVal()
1456+
rawValResults := rawVal.(map[interface{}]interface{})["results"].([]interface{})
1457+
Expect(err).NotTo(HaveOccurred())
1458+
Expect(rawValResults[0]).To(Or(BeEquivalentTo(results[0]), BeEquivalentTo(results[1])))
1459+
Expect(rawValResults[1]).To(Or(BeEquivalentTo(results[0]), BeEquivalentTo(results[1])))
1460+
14591461
// Test with UnstableResp3 false
14601462
Expect(func() {
14611463
options = &redis.FTAggregateOptions{Apply: []redis.FTAggregateApply{{Field: "@CreatedDateTimeUTC * 10", As: "CreatedDateTimeUTC"}}}

0 commit comments

Comments
 (0)