Skip to content

gracefully handle pre-existing binary artifact from failed downloads #4021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2022

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Jan 14, 2022

motivation: when binary artifact download fails it may leave behind a partial or otherwise corrupt file

changes:

  • remove pre-existing archive file before attempting to download the same file again
  • add test

motivation: when binary artifact download fails it may leave behind a partial or otherwise corrupt file

changes:
* remove pre-existing archive file before attempting to download the same file again
* add test
@tomerd
Copy link
Contributor Author

tomerd commented Jan 14, 2022

@swift-ci please smoke test

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Jan 14, 2022
@tomerd tomerd self-assigned this Jan 14, 2022
func testArtifactDownloadArchiveExists() throws {
let sandbox = AbsolutePath("/tmp/ws/")
let fs = InMemoryFileSystem()
// this relies on internal knowledge of the destination path construction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine for a unit test. We could always extract into a static property for the subpath if we feel it's important enough.

@tomerd tomerd merged commit 30ee074 into swiftlang:main Jan 14, 2022
tomerd added a commit to tomerd/swift-package-manager that referenced this pull request Jan 14, 2022
…wiftlang#4021)

motivation: when binary artifact download fails it may leave behind a partial or otherwise corrupt file

changes:
* remove pre-existing archive file before attempting to download the same file again
* add test
@tomerd tomerd requested review from airspeedswift and removed request for airspeedswift January 14, 2022 17:41
tomerd added a commit that referenced this pull request Jan 14, 2022
…4021) (#4025)

motivation: when binary artifact download fails it may leave behind a partial or otherwise corrupt file

changes:
* remove pre-existing archive file before attempting to download the same file again
* add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants