Skip to content

Commit 1746cd2

Browse files
authored
fix address leaks in tests. (#61)
* fix leaks in tests. * Disable leak detection for linux
1 parent 9b79f5b commit 1746cd2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/swift.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@master
3939
- run: swift test --sanitize=thread
40-
# address:
41-
# container:
42-
# image: vapor/swift:5.1-bionic
43-
# runs-on: ubuntu-latest
44-
# steps:
45-
# - uses: actions/checkout@master
46-
# - run: swift test --sanitize=address
40+
address:
41+
container:
42+
image: vapor/swift:5.1-bionic
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@master
46+
- run: ASAN_OPTIONS=detect_leaks=0 swift test --sanitize=address

Tests/APNSwiftTests/APNSwiftRequestTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ final class APNSwiftRequestTests: XCTestCase {
222222
XCTFail("response should not success")
223223
}
224224
}
225+
XCTAssertNoThrow(XCTAssertTrue(try channel.finish().isClean))
225226
}
226227

227228
func testTokenProviderUpdate() {
@@ -261,6 +262,7 @@ final class APNSwiftRequestTests: XCTestCase {
261262
loop.advanceTime(by: .minutes(55))
262263
// Should have changed
263264
XCTAssertFalse(newCachedToken == bearerToken.currentBearerToken)
265+
bearerToken.cancel()
264266

265267
}
266268
static var allTests = [

0 commit comments

Comments
 (0)