@@ -381,13 +381,22 @@ var _ = Describe("Commands", func() {
381381
382382 It ("should ConfigSet Modules" , func () {
383383 SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
384+ defaults := map [string ]string {}
384385 expected := map [string ]string {
385386 "search-min-prefix" : "32" ,
386387 "ts-retention-policy" : "2" ,
387388 "bf-error-rate" : "0.13" ,
388389 "cf-initial-size" : "64" ,
389390 }
390391
392+ // read the defaults to set them back later
393+ for setting , _ := range expected {
394+ val , err := client .ConfigGet (ctx , setting ).Result ()
395+ Expect (err ).NotTo (HaveOccurred ())
396+ defaults [setting ] = val [setting ]
397+ }
398+
399+ // check if new values can be set
391400 for setting , value := range expected {
392401 val , err := client .ConfigSet (ctx , setting , value ).Result ()
393402 Expect (err ).NotTo (HaveOccurred ())
@@ -401,6 +410,14 @@ var _ = Describe("Commands", func() {
401410 Expect (val ).NotTo (BeEmpty ())
402411 Expect (val [setting ]).To (Equal (value ))
403412 }
413+
414+ // set back to the defaults
415+ for setting , value := range defaults {
416+ val , err := client .ConfigSet (ctx , setting , value ).Result ()
417+ Expect (err ).NotTo (HaveOccurred ())
418+ Expect (val ).NotTo (BeEmpty ())
419+ Expect (val ).To (Equal ("OK" ))
420+ }
404421 })
405422
406423 It ("should Fail ConfigSet Modules" , func () {
0 commit comments