File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,7 +83,16 @@ extension GradleHarness {
8383 let linkFrom = localModuleLink. path, linkTo = outputFolder. path
8484 if ( try ? FileManager . default. destinationOfSymbolicLink ( atPath: linkFrom) ) != linkTo {
8585 try ? FileManager . default. removeItem ( atPath: linkFrom) // if it exists
86- try FileManager . default. createSymbolicLink ( atPath: linkFrom, withDestinationPath: linkTo)
86+ do {
87+ try FileManager . default. createSymbolicLink ( atPath: linkFrom, withDestinationPath: linkTo)
88+ } catch {
89+ // Concurrent test targets in the same package race to create the same symlink
90+ // (same linkFrom, same linkTo). If another target won the race, the link will
91+ // already point where we want — treat that as success.
92+ if ( try ? FileManager . default. destinationOfSymbolicLink ( atPath: linkFrom) ) != linkTo {
93+ throw error
94+ }
95+ }
8796 }
8897
8998 let localTranspilerOut = URL ( fileURLWithPath: outputFolder. lastPathComponent, isDirectory: true , relativeTo: localModuleLink)
You can’t perform that action at this time.
0 commit comments