diff --git a/pkg/util/chunk/chunk_in_disk.go b/pkg/util/chunk/chunk_in_disk.go index 0bd0bb195381c..dadcddefd4584 100644 --- a/pkg/util/chunk/chunk_in_disk.go +++ b/pkg/util/chunk/chunk_in_disk.go @@ -19,6 +19,7 @@ import ( "math/rand" "os" "strconv" + "time" "unsafe" errors2 "github.com/pingcap/errors" @@ -333,6 +334,9 @@ func injectChunkInDiskRandomError() error { randNum := rand.Int31n(10000) if randNum < 3 { err = errors2.New("random error is triggered") + } else if randNum < 6 { + delayTime := rand.Int31n(10) + 5 + time.Sleep(time.Duration(delayTime) * time.Millisecond) } } })