@@ -187,8 +187,7 @@ final class TracerTests: XCTestCase {
187
187
#endif
188
188
}
189
189
190
-
191
- func testWithSpan_enterFromNonAsyncCode_passBaggage_asyncOperation( ) async throws {
190
+ func testWithSpan_enterFromNonAsyncCode_passBaggage_asyncOperation( ) throws {
192
191
#if swift(>=5.5) && canImport(_Concurrency)
193
192
guard #available( macOS 10 . 15 , iOS 13 . 0 , tvOS 13 . 0 , watchOS 6 . 0 , * ) else {
194
193
throw XCTSkip ( " Task locals are not supported on this platform. " )
@@ -207,16 +206,18 @@ final class TracerTests: XCTestCase {
207
206
" world "
208
207
}
209
208
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
- }
209
+ self . testAsync {
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
+ }
217
217
218
- XCTAssertEqual ( value, " world " )
219
- XCTAssertTrue ( spanEnded)
218
+ XCTAssertEqual ( value, " world " )
219
+ XCTAssertTrue ( spanEnded)
220
+ }
220
221
#endif
221
222
}
222
223
0 commit comments