Compare commits

...

2 Commits

Author SHA1 Message Date
Zubair Khan d78333e1b5 add new timeout param 2023-05-01 14:44:09 -04:00
Zubair Khan af77a4aad0 double timeout to reduce test failures stemming from timeouts 2023-05-01 13:52:14 -04:00
+3 -3
View File
@@ -10,7 +10,7 @@ type ChunkFunc func(chunk *Chunk) error
var MatchError = errors.New("chunk doesn't match")
func HandleTestChannel(chunksCh chan *Chunk, cf ChunkFunc) error {
func HandleTestChannel(chunksCh chan *Chunk, cf ChunkFunc, timeout int) error {
for {
select {
case gotChunk := <-chunksCh:
@@ -22,8 +22,8 @@ func HandleTestChannel(chunksCh chan *Chunk, cf ChunkFunc) error {
return err
}
return nil
case <-time.After(10 * time.Second):
return fmt.Errorf("no new chunks received after 10 seconds")
case <-time.After(time.Duration(timeout) * time.Second):
return fmt.Errorf("no new chunks received after %d seconds", timeout)
}
}
}