@@ -188,7 +188,7 @@ final class TracerTests: XCTestCase {
188
188
}
189
189
190
190
191
- func testWithSpan_enterFromNonAsyncCode_passBaggage_asyncOperation( ) async throws {
191
+ func testWithSpan_enterFromNonAsyncCode_passBaggage_asyncOperation( ) throws {
192
192
#if swift(>=5.5) && canImport(_Concurrency)
193
193
guard #available( macOS 10 . 15 , iOS 13 . 0 , tvOS 13 . 0 , watchOS 6 . 0 , * ) else {
194
194
throw XCTSkip ( " Task locals are not supported on this platform. " )
@@ -207,16 +207,18 @@ final class TracerTests: XCTestCase {
207
207
" world "
208
208
}
209
209
210
- var fromNonAsyncWorld = Baggage . topLevel
211
- fromNonAsyncWorld. traceID = " 1234-5678 "
212
- let value = await tracer. withSpan ( " hello " , baggage: fromNonAsyncWorld) { ( span: Span ) -> String in
213
- XCTAssertEqual ( span. baggage. traceID, Baggage . current? . traceID)
214
- XCTAssertEqual ( span. baggage. traceID, fromNonAsyncWorld. traceID)
215
- return await operation ( span: span)
216
- }
210
+ self . testAsync {
211
+ var fromNonAsyncWorld = Baggage . topLevel
212
+ fromNonAsyncWorld. traceID = " 1234-5678 "
213
+ let value = await tracer. withSpan ( " hello " , baggage: fromNonAsyncWorld) { ( span: Span ) -> String in
214
+ XCTAssertEqual ( span. baggage. traceID, Baggage . current? . traceID)
215
+ XCTAssertEqual ( span. baggage. traceID, fromNonAsyncWorld. traceID)
216
+ return await operation ( span: span)
217
+ }
217
218
218
- XCTAssertEqual ( value, " world " )
219
- XCTAssertTrue ( spanEnded)
219
+ XCTAssertEqual ( value, " world " )
220
+ XCTAssertTrue ( spanEnded)
221
+ }
220
222
#endif
221
223
}
222
224
0 commit comments