Skip to content

Commit 1c35f30

Browse files
GODRIVER-1969 Use the unified spec test runner for GridFS tests. (#1121)
Co-authored-by: Benjamin Rewis <[email protected]>
1 parent d3466ee commit 1c35f30

17 files changed

+3322
-2397
lines changed

mongo/gridfs/download_stream.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ func (ds *DownloadStream) fillBuffer(ctx context.Context) error {
235235
_ = ds.cursor.Close(ctx)
236236
return ds.cursor.Err()
237237
}
238+
// If there are no more chunks, but we didn't read the expected number of chunks, return an
239+
// ErrWrongIndex error to indicate that we're missing chunks at the end of the file.
240+
if ds.expectedChunk != ds.numChunks {
241+
return ErrWrongIndex
242+
}
238243
return errNoMoreChunks
239244
}
240245

0 commit comments

Comments
 (0)