Skip to content

Commit cc1f567

Browse files
committed
fix(txpipeline): test normal tx pipeline behaviour
1 parent ef6e27a commit cc1f567

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

osscluster_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,7 @@ var _ = Describe("ClusterClient", func() {
462462
Describe("pipelining", func() {
463463
var pipe *redis.Pipeline
464464

465-
assertPipeline := func() {
466-
keys := []string{"A", "B", "C", "D", "E", "F", "G"}
465+
assertPipeline := func(keys []string) {
467466

468467
It("follows redirects", func() {
469468
if !failover {
@@ -547,7 +546,8 @@ var _ = Describe("ClusterClient", func() {
547546

548547
AfterEach(func() {})
549548

550-
assertPipeline()
549+
keys := []string{"A", "B", "C", "D", "E", "F", "G"}
550+
assertPipeline(keys)
551551

552552
It("doesn't fail node with context.Canceled error", func() {
553553
ctx, cancel := context.WithCancel(context.Background())
@@ -590,7 +590,10 @@ var _ = Describe("ClusterClient", func() {
590590

591591
AfterEach(func() {})
592592

593-
assertPipeline()
593+
// TxPipeline doesn't support cross slot commands.
594+
// Use hashtag to force all keys to the same slot.
595+
keys := []string{"A{s}", "B{s}", "C{s}", "D{s}", "E{s}", "F{s}", "G{s}"}
596+
assertPipeline(keys)
594597
})
595598
})
596599

0 commit comments

Comments
 (0)