mirror of
https://github.com/swift-server/swift-service-lifecycle
synced 2026-11-22 04:30:45 +00:00
## Motivation [`testRun_whenServiceThrows_andShutdownGracefully`](https://github.com/swift-server/swift-service-lifecycle/blob/5e3b0e9/Tests/ServiceLifecycleTests/ServiceGroupTests.swift#L433-L441) is flaky. It failed on the Swift 6.3 Linux job: https://github.com/swift-server/swift-service-lifecycle/actions/runs/35197849503/job/105125249343 After service3 exits, the test pings service1 and expects `.runPing` before `.shutdownGracefully`. But the service group sends the graceful shutdown to service1 as soon as service3 exits, so the two events can arrive in either order. ## Modifications Wait for `.shutdownGracefully` on service1 before pinging it, like `testRun_whenServiceThrows_andShutdownGracefully_andOtherServiceThrows` already does. ## Result The test no longer depends on the order of the two events. `ServiceGroupTests` pass locally with Swift 6.3, and `swift format lint --strict` passes.