File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ fileprivate func assertLogging(
22
22
file: StaticString = #filePath,
23
23
line: UInt = #line
24
24
) {
25
- var messages : [ String ] = [ ]
25
+ // nonisolated(unsafe) because calls of `assertLogging` do not log to `logHandler` concurrently.
26
+ nonisolated ( unsafe) var messages : [ String ] = [ ]
26
27
let logger = NonDarwinLogger (
27
28
subsystem: subsystem,
28
29
category: " test " ,
@@ -71,7 +72,8 @@ fileprivate func assertLogging(
71
72
final class LoggingTests : XCTestCase {
72
73
func testLoggingFormat( ) async throws {
73
74
let expectation = self . expectation ( description: " message logged " )
74
- var message : String = " "
75
+ // nonisolated(unsafe) because we only have a single call to `logger.log` and that cannot race.
76
+ nonisolated ( unsafe) var message : String = " "
75
77
let logger = NonDarwinLogger (
76
78
subsystem: subsystem,
77
79
category: " test " ,
You can’t perform that action at this time.
0 commit comments