postgres-nio
postgres-nio copied to clipboard
Fix leakage of promises
resolves #496
Codecov Report
Attention: Patch coverage is 80.50847% with 23 lines in your changes missing coverage. Please review.
Project coverage is 55.17%. Comparing base (
9f84290) to head (892ef0b).
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
| Files with missing lines | Coverage Ξ | |
|---|---|---|
| ...tion State Machine/ExtendedQueryStateMachine.swift | 77.17% <100.00%> (+0.06%) |
:arrow_up: |
| Sources/PostgresNIO/New/NotificationListener.swift | 69.87% <80.00%> (+0.74%) |
:arrow_up: |
| Sources/PostgresNIO/New/PSQLTask.swift | 75.67% <75.00%> (-1.47%) |
:arrow_down: |
| ...w/Connection State Machine/CloseStateMachine.swift | 0.00% <0.00%> (ΓΈ) |
|
| ...nection State Machine/ConnectionStateMachine.swift | 61.18% <75.00%> (-0.03%) |
:arrow_down: |
| ...urces/PostgresNIO/New/PostgresChannelHandler.swift | 83.72% <82.55%> (+0.04%) |
:arrow_up: |
Not sure how exactly add a test for this. something like:
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.
@fabianfett another round of review please π