@@ -1862,7 +1862,7 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
1862
1862
}
1863
1863
})
1864
1864
1865
- It ("should stop processing and return an error when a timeout occurs" , Label ("search" , "ftaggregate" ), func () {
1865
+ FIt ("should stop processing and return an error when a timeout occurs" , Label ("search" , "ftaggregate" ), func () {
1866
1866
SkipBeforeRedisVersion (7.9 , "requires Redis 8.x" )
1867
1867
val , err := client .FTCreate (ctx , "aggTimeoutHeavy" , & redis.FTCreateOptions {},
1868
1868
& redis.FieldSchema {FieldName : "n" , FieldType : redis .SearchFieldTypeNumeric , Sortable : true },
@@ -1871,17 +1871,20 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
1871
1871
Expect (val ).To (BeEquivalentTo ("OK" ))
1872
1872
WaitForIndexing (client , "aggTimeoutHeavy" )
1873
1873
1874
- const totalDocs = 10000
1874
+ const totalDocs = 100000
1875
1875
for i := 0 ; i < totalDocs ; i ++ {
1876
1876
key := fmt .Sprintf ("doc%d" , i )
1877
1877
_ , err := client .HSet (ctx , key , "n" , i ).Result ()
1878
1878
Expect (err ).NotTo (HaveOccurred ())
1879
1879
}
1880
+ // default behaviour was changed in 8.0.1, set to fail to validate the timeout was triggered
1881
+ err = client .ConfigSet (ctx , "search-on-timeout" , "fail" ).Err ()
1882
+ Expect (err ).NotTo (HaveOccurred ())
1880
1883
1881
1884
options := & redis.FTAggregateOptions {
1882
1885
SortBy : []redis.FTAggregateSortBy {{FieldName : "@n" , Desc : true }},
1883
1886
LimitOffset : 0 ,
1884
- Limit : 100 ,
1887
+ Limit : 100000 ,
1885
1888
Timeout : 1 , // 1 ms timeout, expected to trigger a timeout error.
1886
1889
}
1887
1890
_ , err = client .FTAggregateWithArgs (ctx , "aggTimeoutHeavy" , "*" , options ).Result ()
0 commit comments