Open
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #497 +/- ##
==========================================
+ Coverage 55.12% 55.17% +0.05%
==========================================
Files 127 127
Lines 10174 10207 +33
==========================================
+ Hits 5608 5632 +24
- Misses 4566 4575 +9
|
Contributor
Author
|
Not sure how exactly add a test for this. let options = XCTMeasureOptions.default
options.iterationCount = 100
measure(metrics: [XCTMemoryMetric()], options: options) {
do {
let conn = try PostgresConnection.test(on: self.eventLoop).wait()
_ = try conn.query(
"SELECT current_setting('application_name')",
logger: .psqlNoOpLogger
).wait()
try conn.close().wait()
} catch {
XCTFail(String(reflecting: error))
}
}could work but it's too integrated into Xcode. Looks like a case that needs benchmarking, like with package-benchmark. |
MahdiBM
commented
Aug 3, 2024
Sources/PostgresNIO/New/Connection State Machine/ConnectionStateMachine.swift
Outdated
Show resolved
Hide resolved
MahdiBM
commented
Aug 3, 2024
MahdiBM
commented
Aug 3, 2024
fabianfett
reviewed
Aug 5, 2024
fabianfett
reviewed
Aug 5, 2024
MahdiBM
commented
Aug 5, 2024
MahdiBM
commented
Aug 5, 2024
MahdiBM
commented
Aug 5, 2024
MahdiBM
commented
Aug 5, 2024
MahdiBM
commented
Aug 5, 2024
MahdiBM
commented
Aug 5, 2024
MahdiBM
commented
Aug 5, 2024
Contributor
Author
|
@fabianfett another round of review please 🙂 |
fabianfett
requested changes
Aug 6, 2024
afc12db to
7aaae6e
Compare
MahdiBM
commented
Aug 8, 2024
Sources/PostgresNIO/New/Connection State Machine/AuthenticationStateMachine.swift
Outdated
Show resolved
Hide resolved
MahdiBM
commented
Aug 8, 2024
| } | ||
| case .closeCommand(let closeContext): | ||
| case .closeCommand(let closeContext, let writePromise): | ||
| writePromise?.fail(psqlErrror) /// Use `cleanupContext` or not? |
MahdiBM
commented
Aug 8, 2024
Sources/PostgresNIO/New/Connection State Machine/ConnectionStateMachine.swift
Outdated
Show resolved
Hide resolved
MahdiBM
commented
Aug 8, 2024
| case .failure(let error): | ||
| let action = self.state.errorHappened(.unlistenError(underlying: error)) | ||
| self.run(action, with: context) | ||
| writePromise?.fail(error) /// Should I pass the promise to the action? seemed troublesome |
MahdiBM
commented
Aug 8, 2024
| ), | ||
| logger: preparedStatement.logger, | ||
| promise: preparedStatement.promise | ||
| writePromise: nil // Ignore |
fabianfett
reviewed
Aug 8, 2024
Sources/PostgresNIO/New/Connection State Machine/AuthenticationStateMachine.swift
Outdated
Show resolved
Hide resolved
Sources/PostgresNIO/New/Connection State Machine/ConnectionStateMachine.swift
Show resolved
Hide resolved
Sources/PostgresNIO/New/Connection State Machine/ConnectionStateMachine.swift
Outdated
Show resolved
Hide resolved
Sources/PostgresNIO/New/Connection State Machine/ConnectionStateMachine.swift
Outdated
Show resolved
Hide resolved
MahdiBM
commented
Aug 8, 2024
| switch task { | ||
| case .extendedQuery(let queryContext): | ||
| case .extendedQuery(let queryContext, let writePromise): | ||
| writePromise?.fail(psqlErrror) /// Use `cleanupContext` or not? |
MahdiBM
commented
Aug 8, 2024
| return .sendBindExecuteSync(prepared, promise: promise) | ||
| } | ||
|
|
||
| /// Not my code, but this is ignoring the last argument which is a promise? is that fine? |
MahdiBM
commented
Aug 8, 2024
| list.startListeningSucceeded(handler: self, writePromise: nil) | ||
| } | ||
|
|
||
| writePromise?.succeed(()) /// Should we instead do smth like "whenAllSucceed"? |
b966180 to
8b944b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #496