Skip to content

Fix flaky Driver tests #27780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2019
Merged

Conversation

beccadax
Copy link
Contributor

Several Driver tests create a hard link to the compiler in a temporary directory, then invoke it through that hard link to see how it locates items in the resource directory. This pattern can tickle a system-load-dependent macOS bug involving invocations of freshly-created hard links, causing rare test failures in CI or on contributors’ machines.

This change avoids the OS bug by always copying instead of hard linking. We already fall back to copying on Windows, so all tests should pass with a copy anyway. Removing this workaround will be tracked by rdar://problem/53507844.

Several Driver tests create a hard link to the compiler in a temporary directory, then invoke it thorugh that hard link to see how it locates items in the resource directory. This pattern can tickle a system-load-dependent macOS bug involving invocations of freshly-created hard links, causing rare test failures in CI or on contributors’ machines.

This change avoids the OS bug by always copying instead of hard linking. We already fall back to copying on Windows, so all tests should pass with a copy anyway. Removing this workaround will be tracked by rdar://problem/53507844.
@beccadax
Copy link
Contributor Author

Tests that currently use %hardlink-or-copy include:

  • test/Driver/driver-compile.swift
  • test/Driver/linker.swift
  • test/Driver/linker-clang_rt.swift
  • test/Driver/options-repl.swift
  • test/Driver/options-repl-darwin.swift
  • test/Driver/subcommands.swift
  • test/Driver/windows-link-job.swift

@beccadax
Copy link
Contributor Author

@swift-ci please smoke test

@beccadax beccadax requested a review from shahmishal October 18, 2019 21:41
@beccadax
Copy link
Contributor Author

Tagging @shahmishal for a review because I expect this to slightly increase time and space needed during testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant