Conversation
cefa86d to
d1b1456
Compare
Motivation * Several tests failed when testing against simulators for Apple platforms (iOS, tvOS, watchOS, visionOS) Modifications * Added `@available(macOS 13, iOS 16, tvOS 16, watchOS 9, *)` to each `@Test` method in `NIOThreadPoolTest`, `EventLoopFutureTest`, and `NIOTransportAccessibleChannelCoreTests` to match the availability of the APIs they use (`timeLimit` and `withUnsafeTransportIfAvailable`). * Removed `.timeLimit(.minutes(1))` from the `@Suite` declarations on `NIOThreadPoolTest` and `EventLoopFutureTest` - the `@Suite` macro cannot be used with `@available`, so `timeLimit` cannot be used. * Skip `testHomeDirectoryFromPasswd` on simulator targets via `#if targetEnvironment(simulator)` / `XCTSkip`, since simulators return success but nil information when invoking `getpwuid_r`. Result * Apple simulator platform builds and test runs no longer fail due to these issues. Some infrastructure issues remain to be resolved separately.
d1b1456 to
39dc209
Compare
| #if targetEnvironment(simulator) | ||
| // Simulators don't have a passwd database entry for the current user. | ||
| throw XCTSkip("getpwuid_r has no passwd entry in simulator environments") | ||
| #else |
There was a problem hiding this comment.
Nit: This can just be #endif
| #else | |
| #endif |
There was a problem hiding this comment.
I don't think it can be, if it was then we got a warning that there was code after the throw which would never be reached
| case .failure(let errno): | ||
| XCTFail("Expected success, got error: \(errno)") | ||
| } | ||
| #endif |
There was a problem hiding this comment.
Nit: We don't need this (but only if we take the other nit suggestion)
| #endif |
| } | ||
|
|
||
| @Suite("EventLoopFutureTest", .serialized, .timeLimit(.minutes(1))) | ||
| @Suite("EventLoopFutureTest", .serialized) |
There was a problem hiding this comment.
So, one thing this did was mean that we had an early failure rather than waiting for the GitHub job-level timeout to tell us we caused an issue here. Do we just have to sacrifice that feature of the tests?
There was a problem hiding this comment.
I think so, unless you know of a smart way to add it back. That feature has availability requirements and you can't combine availability requirements with @Suite macros.
Apple platform simulator CI failures
Motivation
platforms (iOS, tvOS, watchOS, visionOS)
Modifications
@available(macOS 13, iOS 16, tvOS 16, watchOS 9, *)to each@Testmethod inNIOThreadPoolTest,EventLoopFutureTest, andNIOTransportAccessibleChannelCoreTeststo match the availability ofthe APIs they use (
timeLimitandwithUnsafeTransportIfAvailable)..timeLimit(.minutes(1))from the@Suitedeclarations onNIOThreadPoolTestandEventLoopFutureTest- the@Suitemacrocannot be used with
@available, sotimeLimitcannot be used.testHomeDirectoryFromPasswdon simulator targets via#if targetEnvironment(simulator)/XCTSkip, since simulators retu>success but nil information when invoking
getpwuid_r.Result
these issues. Some infrastructure issues remain to be resolved
separately.