Automattic / hostmgr

A tool for managing macOS VM hosts
Mozilla Public License 2.0
9 stars 3 forks source link

Ensure we shutdown the S3 client even when operations fail #43

Closed mokagio closed 1 year ago

mokagio commented 1 year ago

I've been unsuccessfully trying to test #41, my attempts failing with:

➜ swift run hostmgr benchmark network
Building for debugging...
Build complete! (0.29s)
SotoCore/AWSClient.swift:110: Assertion failed: AWSClient not shut down before the deinit. Please call client.syncShutdown() when no longer needed.
[1]    65387 trace trap  swift run hostmgr benchmark network

I've been doing some digging and discovered that error was hiding the actual one thrown by the command. This PR addresses the issue.

My attempts are still failing, but now the error is more accurate:

➜ swift run hostmgr benchmark network
Building for debugging...
Build complete! (0.30s)
Error: No credential provider found
mokagio commented 1 year ago

I addressed @crazytonyli's comment (thanks!) but I'm skeptical of merging myself till I can reproduce the happy path as well as the error one.

I'll try to work on this soon, but if you read this comment and can reproduce easily, before I merged, then I'd appreciate if you could merge this PR.