@@ -1862,7 +1862,7 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
18621862 }
18631863 })
18641864
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 () {
18661866 SkipBeforeRedisVersion (7.9 , "requires Redis 8.x" )
18671867 val , err := client .FTCreate (ctx , "aggTimeoutHeavy" , & redis.FTCreateOptions {},
18681868 & redis.FieldSchema {FieldName : "n" , FieldType : redis .SearchFieldTypeNumeric , Sortable : true },
@@ -1871,17 +1871,20 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
18711871 Expect (val ).To (BeEquivalentTo ("OK" ))
18721872 WaitForIndexing (client , "aggTimeoutHeavy" )
18731873
1874- const totalDocs = 10000
1874+ const totalDocs = 100000
18751875 for i := 0 ; i < totalDocs ; i ++ {
18761876 key := fmt .Sprintf ("doc%d" , i )
18771877 _ , err := client .HSet (ctx , key , "n" , i ).Result ()
18781878 Expect (err ).NotTo (HaveOccurred ())
18791879 }
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 ())
18801883
18811884 options := & redis.FTAggregateOptions {
18821885 SortBy : []redis.FTAggregateSortBy {{FieldName : "@n" , Desc : true }},
18831886 LimitOffset : 0 ,
1884- Limit : 100 ,
1887+ Limit : 100000 ,
18851888 Timeout : 1 , // 1 ms timeout, expected to trigger a timeout error.
18861889 }
18871890 _ , err = client .FTAggregateWithArgs (ctx , "aggTimeoutHeavy" , "*" , options ).Result ()
0 commit comments