File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ var _ = Describe("pipelining", func() {
6060 Expect (cmds ).To (BeEmpty ())
6161 })
6262
63- It ("basic pipeline exec" , func () {
63+ It ("pipeline: basic exec" , func () {
6464 p := client .Pipeline ()
6565 p .Get (ctx , "key" )
6666 p .Set (ctx , "key" , "value" , 0 )
@@ -75,6 +75,24 @@ var _ = Describe("pipelining", func() {
7575 Expect (cmds [2 ].Err ()).NotTo (HaveOccurred ())
7676 })
7777
78+ It ("pipeline: exec pipeline when get conn failed" , func () {
79+ p := client .Pipeline ()
80+ p .Get (ctx , "key" )
81+ p .Set (ctx , "key" , "value" , 0 )
82+ p .Get (ctx , "key" )
83+
84+ client .Close ()
85+
86+ cmds , err := p .Exec (ctx )
87+ Expect (err ).To (Equal (redis .ErrClosed ))
88+ Expect (cmds ).To (HaveLen (3 ))
89+ for _ , cmd := range cmds {
90+ Expect (cmd .Err ()).To (Equal (redis .ErrClosed ))
91+ }
92+
93+ client = redis .NewClient (redisOptions ())
94+ })
95+
7896 assertPipeline := func () {
7997 It ("returns no errors when there are no commands" , func () {
8098 _ , err := pipe .Exec (ctx )
You can’t perform that action at this time.
0 commit comments