File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,11 +9,22 @@ import Testing
99
1010@testable import PropertyBased
1111
12- func gatherIssues( block : @ Sendable ( ) async throws -> Void ) async -> [ String ] {
12+ func gatherIssues( isolation : isolated ( any Actor ) ? = #isolation , block : ( ) async throws -> Void ) async -> [ String ] {
1313 let mutex = Mutex ( [ ] as [ String ] )
1414
15- // No way to stop issues from still being recorded. Ignore those for now.
16- await withKnownIssue ( isIntermittent: true ) {
15+ #if swift(>=6.2)
16+ nonisolated ( unsafe) let closure = block
17+
18+ let handler = IssueHandlingTrait . filterIssues { issue in
19+ mutex. withLock { $0. append ( issue. description) }
20+ return false
21+ }
22+
23+ try ? await handler. provideScope ( for: Test . current!, testCase: Test . Case. current) {
24+ try await run ( closure, in: isolation)
25+ }
26+ #else
27+ await withKnownIssue ( isIntermittent: true , isolation: isolation) {
1728 do {
1829 try await block ( )
1930 } catch {
@@ -23,6 +34,7 @@ func gatherIssues(block: @Sendable () async throws -> Void) async -> [String] {
2334 mutex. withLock { $0. append ( issue. description) }
2435 return true
2536 }
37+ #endif
2638
2739 return mutex. withLock { $0 }
2840}
You can’t perform that action at this time.
0 commit comments