test(download): add unit/integration tests for parallel download engine #139
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/pget#139
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
internal/downloader/download.gohas no tests. 207 lines of core download logic — the heart of pget — with zero test coverage.Critical paths to cover:
Download()— HTTP with ranges, HTTP without ranges, FTP with REST, FTP without RESTrunWorker— successful chunk, retry on failure, context cancellation during backoffdownloadChunkHTTP— 206 response, 200 response, error status, network failuredownloadChunkFTP— successful RETR, connection failurewriteAtSeeker— WriteAt positioningpreallocFile— normal creation, truncate failureretryBackoff— backoff timing for each attemptisFTPURL— ftp://, ftps://, http://, https://Use
httptest.NewServerwith range-aware handler for HTTP tests.Discovered during review of PR #137.
Closing — handled in PR #161. download_test.go has 16 tests covering parallel download, range, no-range, resume, retries, checksum, rate limiting, and context cancellation.