Skip to content

Commit

Permalink
test: skip block check if no deplay after flush
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Feb 7, 2024
1 parent 7576c30 commit 9adddbc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pipe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,31 @@ func TestWriteWithMaxFlushDelay(t *testing.T) {
}
}

func TestBlockWriteWithNoMaxFlushDelay(t *testing.T) {
defer ShouldNotLeaked(SetupLeakDetection())
p, mock, cancel, _ := setup(t, ClientOption{
AlwaysPipelining: true,
MaxFlushDelay: 20 * time.Microsecond,
})
defer cancel()
times := 2000
wg := sync.WaitGroup{}
wg.Add(times)

for i := 0; i < times; i++ {
go func() {
for _, resp := range p.DoMulti(context.Background(),
cmds.NewBlockingCompleted([]string{"PING"}),
cmds.NewBlockingCompleted([]string{"PING"})).s {
ExpectOK(t, resp)
}
}()
}
for i := 0; i < times; i++ {
mock.Expect("PING").ReplyString("OK").Expect("PING").ReplyString("OK")
}
}

func TestWriteMultiFlush(t *testing.T) {
defer ShouldNotLeaked(SetupLeakDetection())
p, mock, cancel, _ := setup(t, ClientOption{})
Expand Down

0 comments on commit 9adddbc

Please sign in to comment.