Skip to content

Commit b3bd35b

Browse files
authored
Merge pull request #27780 from brentdax/a-link-to-the-past
Fix flaky Driver tests
2 parents e67921f + 214598d commit b3bd35b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/lit.cfg

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,9 +1556,17 @@ if hasattr(config, 'target_cc_options'):
15561556
else:
15571557
config.substitutions.append(('%target-cc-options', ''))
15581558

1559-
config.substitutions.append(
1560-
(r'%hardlink-or-copy\(from: *(.*), *to: *(.*)\)',
1561-
SubstituteCaptures(r'ln \1 \2 || cp \1 \2')))
1559+
# WORKAROUND(rdar://53507844): On some macOS versions, we see flaky failures in
1560+
# tests which create a hard link to an executable and immediately invoke it.
1561+
# Work around this by always copying on Darwin.
1562+
if platform.system() == 'Darwin':
1563+
config.substitutions.append(
1564+
(r'%hardlink-or-copy\(from: *(.*), *to: *(.*)\)',
1565+
SubstituteCaptures(r'cp \1 \2')))
1566+
else:
1567+
config.substitutions.append(
1568+
(r'%hardlink-or-copy\(from: *(.*), *to: *(.*)\)',
1569+
SubstituteCaptures(r'ln \1 \2 || cp \1 \2')))
15621570

15631571
config.substitutions.append(('%utils', config.swift_utils))
15641572
config.substitutions.append(('%line-directive', '%r %s' % (sys.executable, config.line_directive)))

0 commit comments

Comments
 (0)