Skip to content

Commit

Permalink
remove syncShutdown() s
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed May 21, 2024
1 parent 65c4d58 commit 99047f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
12 changes: 5 additions & 7 deletions Sources/Penny/Penny.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ struct Penny {
)
let awsClient = AWSClient(httpClient: httpClient)

/// These shutdown calls are only useful for tests where we call `Penny.main()` repeatedly
defer {
/// Shutdown in reverse order of dependance.
try! awsClient.syncShutdown()
try! httpClient.syncShutdown()
}

try await mainService.bootstrapLoggingSystem(httpClient: httpClient)

let bot = try await mainService.makeBot(
Expand All @@ -46,5 +39,10 @@ struct Penny {
for await event in await bot.events {
EventHandler(event: event, context: context).handle()
}

/// These shutdown calls are only useful for tests where we call `Penny.main()` repeatedly
/// Shutdown in reverse order of dependance.
try! await awsClient.shutdown()
try! await httpClient.shutdown()
}
}
4 changes: 0 additions & 4 deletions Tests/PennyTests/Fake/FakeMainService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ actor FakeMainService: MainService {
)
}

deinit {
try! httpClient.syncShutdown()
}

func bootstrapLoggingSystem(httpClient: HTTPClient) async throws { }

func makeBot(httpClient: HTTPClient) async throws -> any GatewayManager {
Expand Down
4 changes: 0 additions & 4 deletions Tests/PennyTests/Tests/GHHooksTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ class GHHooksTests: XCTestCase {
FakeResponseStorage.shared = FakeResponseStorage()
}

override func tearDown() {
try! httpClient.syncShutdown()
}

func testUnicodesPrefix() throws {
do {
let scalars_16 = "Hello, world! 👍🏾"
Expand Down
4 changes: 2 additions & 2 deletions Tests/PennyTests/Tests/LeafRenderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class LeafRenderTests: XCTestCase {
FakeResponseStorage.shared = FakeResponseStorage()
}

override func tearDown() {
try! httpClient.syncShutdown()
override func tearDown() async throws {
try! await httpClient.shutdown()
}

func testTranslationNeededDescription() async throws {
Expand Down

0 comments on commit 99047f2

Please sign in to comment.