Skip to content

[Tests][Explicit Module Builds] Fix per-test state in incremental explicitly-built module tests to avoid conflicts on parallel test runs #1632

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
Jun 12, 2024

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jun 12, 2024

No description provided.

…licitly-built module tests to avoid conflicts on parallel test runs
@artemcm artemcm requested a review from adrian-prantl June 12, 2024 17:49
@artemcm
Copy link
Contributor Author

artemcm commented Jun 12, 2024

@swift-ci test

@@ -19,10 +19,7 @@ import TestUtilities

// MARK: - Instance variables and initialization
final class IncrementalCompilationTests: XCTestCase {

var tempDir: AbsolutePath = try! AbsolutePath(validating: "/tmp")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not hardcoding /tmp to use as a temporary directory, are we? We should have something similar to LLVM's implementation:
https://github.com/llvm/llvm-project/blob/ca33796d54ce6d2c711032b269caf32851c5915a/llvm/lib/Support/Unix/Path.inc#L1452

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the default, but it does get overridden for each test in the setUp.

@@ -90,15 +109,38 @@ final class IncrementalCompilationTests: XCTestCase {

override func setUp() {
self.tempDir = try! withTemporaryDirectory(removeTreeOnDeinit: false) {$0}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see!

@artemcm artemcm merged commit cf79f6e into swiftlang:main Jun 12, 2024
3 checks passed
@artemcm artemcm deleted the FixIncrementalEBMTestState branch June 12, 2024 20:45
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.

2 participants