Handle a case where transfers channel was not closed properly.

This commit is contained in:
Sebastian Zagrodzki
2017-04-26 21:50:10 +02:00
parent ae8627a890
commit cdd4223813
2 changed files with 15 additions and 0 deletions

View File

@@ -198,6 +198,18 @@ func TestReadStream(t *testing.T) {
{err: io.ErrClosedPipe},
},
},
{
desc: "fail quickly",
transfers: [][]fakeStreamResult{
{{waitErr: sentinelError}},
{{n: 500}},
{{n: 500}},
},
want: []readRes{
{err: sentinelError},
{err: io.ErrClosedPipe},
},
},
} {
t.Run(strconv.Itoa(tcNum), func(t *testing.T) {
t.Logf("Case %d: %s", tcNum, tc.desc)