File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Tests/AsyncDNSResolverTests/c-ares Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ final class CAresDNSResolverTests: XCTestCase {
2929 options. servers = servers
3030
3131 self . resolver = try ! CAresDNSResolver ( options: options)
32- self . verbose = ProcessInfo . processInfo . environment [ " VERBOSE_TESTS " ] == " true "
32+ self . verbose = true // TODO: Undo this before merging!!!
3333 }
3434
3535 override func tearDown( ) {
@@ -122,11 +122,19 @@ final class CAresDNSResolverTests: XCTestCase {
122122 }
123123
124124 func test_concurrency( ) async throws {
125+ let verbose = self . verbose
126+
125127 func run(
126128 _ name: String ,
127129 times: Int = 100 ,
128130 _ query: @Sendable @escaping ( _ index: Int ) async throws -> Void
129131 ) async throws {
132+ let start = Date . now
133+ defer {
134+ if verbose {
135+ print ( " Test of \( name) took \( Int64 ( start. timeIntervalSinceNow * - 1000 ) ) ms. " )
136+ }
137+ }
130138 do {
131139 try await withThrowingTaskGroup ( of: Void . self) { group in
132140 for i in 1 ... times {
@@ -137,13 +145,14 @@ final class CAresDNSResolverTests: XCTestCase {
137145 for try await _ in group { }
138146 }
139147 } catch {
140- print ( " Test of \( name) is throwing an error. " )
148+ if verbose {
149+ print ( " Test of \( name) is throwing an error. " )
150+ }
141151 throw error
142152 }
143153 }
144154
145155 let resolver = self . resolver!
146- let verbose = self . verbose
147156 try await run ( " queryA " ) { i in
148157 let reply = try await resolver. queryA ( name: " apple.com " )
149158 if verbose {
You can’t perform that action at this time.
0 commit comments