1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-06 01:35:48 +03:00

Backport wrapMultiExec() cmds copy bug fix from v8 (#1823)

This commit is contained in:
Wesley Powell
2021-07-16 02:41:17 -05:00
committed by GitHub
parent 5fec34b901
commit 03a86486ea
3 changed files with 23 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
package redis_test
import (
"strconv"
"github.com/go-redis/redis/v7"
. "github.com/onsi/ginkgo"
@@ -67,6 +69,21 @@ var _ = Describe("pipelining", func() {
Expect(err).NotTo(HaveOccurred())
Expect(cmds).To(HaveLen(1))
})
It("handles large pipelines", func() {
for callCount := 1; callCount < 16; callCount++ {
for i := 1; i <= callCount; i++ {
pipe.SetNX(strconv.Itoa(i)+"_key", strconv.Itoa(i)+"_value", 0)
}
cmds, err := pipe.Exec()
Expect(err).NotTo(HaveOccurred())
Expect(cmds).To(HaveLen(callCount))
for _, cmd := range cmds {
Expect(cmd).To(BeAssignableToTypeOf(&redis.BoolCmd{}))
}
}
})
}
Describe("Pipeline", func() {