Skip to content

Commit db1e474

Browse files
author
David Ungar
authored
Merge pull request #374 from davidungar/tempDir
Ensure temp dir is different between testIncremental and testIncrementalDiagnostics to see if that fixes the test breakage in CI
2 parents 34bd4c0 + ce861ee commit db1e474

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Tests/SwiftDriverTests/IncrementalCompilationTests.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,12 @@ final class IncrementalCompilationTests: XCTestCase {
341341
}
342342

343343
override func setUp() {
344-
self.tempDir = try! withTemporaryDirectory(removeTreeOnDeinit: false) {$0}
344+
// Prefix directory with test name to ensure directory name is unique when
345+
// testing in parallel.
346+
// name returns e.g. "[SwiftDriverTests.IncrementalCompilationTests testIncremental]
347+
// but we just want "testIncremental"
348+
let testName = name.split(separator: " ").last!.dropLast()
349+
self.tempDir = try! withTemporaryDirectory(prefix: String(testName), removeTreeOnDeinit: false) {$0}
345350
try! localFileSystem.createDirectory(derivedDataPath)
346351
writeOutputFileMapData(module: module,
347352
inputPaths: inputPathsAndContents.map {$0.0},
@@ -355,11 +360,8 @@ final class IncrementalCompilationTests: XCTestCase {
355360
}
356361
}
357362

358-
// FIXME: why does it fail on Linux in CI?
359363
func testIncrementalDiagnostics() throws {
360-
#if !os(Linux)
361364
try testIncremental(checkDiagnostics: true)
362-
#endif
363365
}
364366

365367
func testIncremental() throws {

0 commit comments

Comments
 (0)