-
Notifications
You must be signed in to change notification settings - Fork 65
SWIFT-1337, SWIFT-1629, SWIFT-1557, SWIFT-1566: Various maintenance-related changes #773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1087,6 +1205,13 @@ axes: | |||
PYTHON: "/opt/mongodbtoolchain/v3/bin/python3" | |||
VENV_BIN_DIR: "bin" | |||
|
|||
- id: macos-10.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for similar reasons to the BSON PR re limited 10.15 hosts, the Swift 5.2 tests are now run on macOS 10.14
@@ -1418,4 +1554,4 @@ buildvariants: | |||
ssl-auth: "*" | |||
check-leaks: "leaks" | |||
tasks: | |||
- ".5.0" | |||
- ".6.0 !.load-balancer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we check for leaks on macOS which does not have haproxy installed and so cannot run LB tests.
this explicit skip wasn't necessary before because we were not running LB tests on 5.0
#if compiler(>=5.5.2) && canImport(_Concurrency) | ||
return .upToNextMajor(from: "2.36.0") | ||
#else | ||
return .upToNextMajor(from: "2.15.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could have left this in and updated this to be NIO 2.32 (the minimum version where the separate modules exist), but there didn't seem to be a huge benefit to doing so as 2.36.0 supports 5.2+, so I thought it was simpler and reasonable to remove the extra complexity here and require everyone to be on 2.36+.
message: "defaultAuthDB contains invalid character: \(character)" | ||
) | ||
} | ||
for character in Self.forbiddenDBCharacters where defaultAuthDB.contains(character) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and the other change in the file were linter changes due to the version updates. there's a swiftlint rule around preferring "for... where" over a "for" loop with a single nested "if", and I guess swiftlint previously missed these violations
_ = try client.db(entity.namespace.db).runCommand( | ||
["distinct": .string(entity.name), "key": "_id"] | ||
) | ||
} catch let commandError as MongoError.CommandError where commandError.code == 26 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that after I synced in the unified change stream spec tests, they started to fail on macOS + sharded clusters, with a similar NamespaceNotFound error problem to that Rohan was encountering.
I think this was likely also an issue around the exact namespaces that exist / don't exist at the time those tests are run due to test ordering
if !event.isHeartbeatEvent { | ||
eventTypeSdam.append(event.type) | ||
} | ||
for try await event in client.sdamEventStream() where !event.isHeartbeatEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another linter change
@@ -320,7 +320,7 @@ final class EventLoopBoundMongoClientTests: MongoSwiftTestCase { | |||
defer { try? db.drop().wait() } | |||
|
|||
let wrongEventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 4).next() | |||
let withSessionFuture: EventLoopFuture<[String]> = elBoundClient.withSession { session in | |||
let withSessionFuture = elBoundClient.withSession { session in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the explicit annotation is not needed anymore, and that saves us importing NIOCore here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! awesome job knocking all these different things out
This is a collection of several minor changes; my original motivation here was dropping Swift 5.1 support and only depending on the necessary NIO modules, but in the process I ended up picking up some various greener build and Evergreen maintenance type changes that we've fallen behind on in recent months.
Included changes:
successful patch - failures are:
APMTests.testCommandStreamBufferingPolicy
perhaps needs a slightly longer timeout - it failed on sharded cluster + SSL + auth + macOS, the notoriously slow combo. I filed a separate ticket about addressing the flakiness: SWIFT-1630