Skip to content

Commit

Permalink
Fix global concurrency hook integration test
Browse files Browse the repository at this point in the history
# Motivation

Our global concurrency hook was guarding against known Swift versions. Since the nightly are now Swift 6.1 we need to adjust our compiler guards.

# Modification

This PR adjusts our compiler guards for the concurrency hooks.

# Result

Concurrency hooks for everyone
  • Loading branch information
FranzBusch committed Sep 2, 2024
1 parent 76f39c1 commit 6dea6ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/NIOCrashTester/CrashTests+EventLoop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ struct EventLoopCrashTests {
NIOSingletons.groupLoopCountSuggestion = -1
}

#if compiler(>=5.9) && swift(<5.11) // We only support Concurrency executor take-over on 5.9-5.10, as versions greater than 5.10 have not been properly tested.
#if compiler(>=5.9) && swift(<6.2) // We only support Concurrency executor take-over on those Swift versions, as versions greater than that have not been properly tested.
let testInstallingSingletonMTELGAsConcurrencyExecutorWorksButOnlyOnce = CrashTest(
regex: #"Fatal error: Must be called only once"#
) {
Expand All @@ -207,6 +207,6 @@ struct EventLoopCrashTests {
// This should crash
_ = NIOSingletons.unsafeTryInstallSingletonPosixEventLoopGroupAsConcurrencyGlobalExecutor()
}
#endif // compiler(>=5.9) && swift(<5.11)
#endif // compiler(>=5.9) && swift(<6.2)
}
#endif // !canImport(Darwin) || os(macOS)
2 changes: 1 addition & 1 deletion Sources/NIOPosix/PosixSingletons+ConcurrencyTakeOver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extension NIOSingletons {
@discardableResult
public static func unsafeTryInstallSingletonPosixEventLoopGroupAsConcurrencyGlobalExecutor() -> Bool {
// Guard between the minimum and maximum supported version for the hook
#if compiler(>=5.9) && compiler(<6.1)
#if compiler(>=5.9) && compiler(<6.2)
guard #available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) else {
return false
}
Expand Down

0 comments on commit 6dea6ea

Please sign in to comment.