diff --git a/markets/dagstore/mount_test.go b/markets/dagstore/mount_test.go index ec5e8a086..820058786 100644 --- a/markets/dagstore/mount_test.go +++ b/markets/dagstore/mount_test.go @@ -30,7 +30,6 @@ func TestLotusMount(t *testing.T) { mockLotusMountAPI := mock_dagstore.NewMockMinerAPI(mockCtrl) mockLotusMountAPI.EXPECT().IsUnsealed(gomock.Any(), cid).Return(true, nil).Times(1) - mockLotusMountAPI.EXPECT().FetchUnsealedPiece(gomock.Any(), cid, uint64(0)).Return(ioutil.NopCloser(strings.NewReader("testing")), abi.UnpaddedPieceSize(7), nil).Times(1) mockLotusMountAPI.EXPECT().FetchUnsealedPiece(gomock.Any(), cid, uint64(0)).Return(ioutil.NopCloser(strings.NewReader("testing")), abi.UnpaddedPieceSize(7), nil).Times(1) mockLotusMountAPI.EXPECT().GetUnpaddedCARSize(ctx, cid).Return(uint64(100), nil).Times(1) diff --git a/markets/dagstore/piecereader.go b/markets/dagstore/piecereader.go index 14a027bd1..67cd10c27 100644 --- a/markets/dagstore/piecereader.go +++ b/markets/dagstore/piecereader.go @@ -155,6 +155,9 @@ func (p *pieceReader) ReadAt(b []byte, off int64) (n int, err error) { if n < len(b) { log.Debugw("pieceReader short read", "piece", p.pieceCid, "at", p.rAt, "toEnd", int64(p.len)-p.rAt, "n", len(b), "read", n, "err", err) } + if err == io.ErrUnexpectedEOF { + err = io.EOF + } p.rAt += int64(n) return n, err