rpc: improve cancel test (#20752)

This is supposed to fix the occasional failures in 
TestCancel* on Travis CI.
This commit is contained in:
Felix Lange
2020-03-12 11:24:36 +01:00
committed by GitHub
parent 0bdb21f0cb
commit b1efff659e
3 changed files with 15 additions and 8 deletions

View File

@ -77,6 +77,11 @@ func (s *testService) Sleep(ctx context.Context, duration time.Duration) {
time.Sleep(duration)
}
func (s *testService) Block(ctx context.Context) error {
<-ctx.Done()
return errors.New("context canceled in testservice_block")
}
func (s *testService) Rets() (string, error) {
return "", nil
}