Skip to content

Commit d859951

Browse files
committed
Disable flaky tests on Windows
The goal for now is to get to a state where Windows tests are passing. Once we have that, we can start enabling tests again as we fix their unerlying issues.
1 parent b9dd254 commit d859951

File tree

8 files changed

+102
-1
lines changed

8 files changed

+102
-1
lines changed

Sources/SKTestSupport/FindTool.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ package func findTool(name: String) async -> URL? {
3131
#elseif os(Windows)
3232
var buf = [WCHAR](repeating: 0, count: Int(MAX_PATH))
3333
GetWindowsDirectoryW(&buf, DWORD(MAX_PATH))
34-
var wherePath = String(decodingCString: &buf, as: UTF16.self)
34+
let wherePath = String(decodingCString: &buf, as: UTF16.self)
3535
.appendingPathComponent("system32")
3636
.appendingPathComponent("where.exe")
3737
let cmd = [wherePath, name]

Sources/SKTestSupport/SwiftPMTestProject.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ package import SKOptions
1717
package import SourceKitLSP
1818
import TSCBasic
1919
import ToolchainRegistry
20+
import XCTest
2021
#else
2122
import Foundation
2223
import LanguageServerProtocol
2324
import SKOptions
2425
import SourceKitLSP
2526
import TSCBasic
2627
import ToolchainRegistry
28+
import XCTest
2729
#endif
2830

2931
private struct SwiftSyntaxCShimsModulemapNotFoundError: Error {}
@@ -171,6 +173,13 @@ package class SwiftPMTestProject: MultiFileTestProject {
171173
cleanUp: (@Sendable () -> Void)? = nil,
172174
testName: String = #function
173175
) async throws {
176+
#if os(Windows)
177+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
178+
try XCTSkipIf(
179+
true,
180+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
181+
)
182+
#endif
174183
var filesByPath: [RelativeFileLocation: String] = [:]
175184
for (fileLocation, contents) in files {
176185
let directories =

Tests/SourceKitLSPTests/BackgroundIndexingTests.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,14 @@ final class BackgroundIndexingTests: XCTestCase {
535535
}
536536

537537
func testPrepareTargetAfterEditToDependency() async throws {
538+
#if os(Windows)
539+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
540+
try XCTSkipIf(
541+
true,
542+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
543+
)
544+
#endif
545+
538546
var testHooks = TestHooks()
539547
let expectedPreparationTracker = ExpectedIndexTaskTracker(expectedPreparations: [
540548
[
@@ -634,6 +642,14 @@ final class BackgroundIndexingTests: XCTestCase {
634642
}
635643

636644
func testDontStackTargetPreparationForEditorFunctionality() async throws {
645+
#if os(Windows)
646+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
647+
try XCTSkipIf(
648+
true,
649+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
650+
)
651+
#endif
652+
637653
let allDocumentsOpened = WrappedSemaphore(name: "All documents opened")
638654
let libBStartedPreparation = WrappedSemaphore(name: "LibB started preparing")
639655
let libDPreparedForEditing = WrappedSemaphore(name: "LibD prepared for editing")
@@ -765,6 +781,14 @@ final class BackgroundIndexingTests: XCTestCase {
765781
}
766782

767783
func testIndexingHappensInParallel() async throws {
784+
#if os(Windows)
785+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
786+
try XCTSkipIf(
787+
true,
788+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
789+
)
790+
#endif
791+
768792
let fileAIndexingStarted = WrappedSemaphore(name: "FileA indexing started")
769793
let fileBIndexingStarted = WrappedSemaphore(name: "FileB indexing started")
770794

Tests/SourceKitLSPTests/PullDiagnosticsTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,14 @@ final class PullDiagnosticsTests: XCTestCase {
300300
}
301301

302302
func testDontReturnEmptyDiagnosticsIfDiagnosticRequestIsCancelled() async throws {
303+
#if os(Windows)
304+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
305+
try XCTSkipIf(
306+
true,
307+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
308+
)
309+
#endif
310+
303311
let diagnosticRequestCancelled = self.expectation(description: "diagnostic request cancelled")
304312
let packageLoadingDidFinish = self.expectation(description: "Package loading did finish")
305313
var testHooks = TestHooks()

Tests/SourceKitLSPTests/ReferencesTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import XCTest
1717
/// Tests that test the overall state of the SourceKit-LSP server, that's not really specific to any language
1818
final class ReferencesTests: XCTestCase {
1919
func testReferencesInMacro() async throws {
20+
#if os(Windows)
21+
// FIXME: https://github.com/swiftlang/sourcekit-lsp/issues/1758
22+
try XCTSkipIf(true, "Disabled until https://github.com/swiftlang/sourcekit-lsp/issues/1758 is fixed")
23+
#endif
2024
let project = try await IndexedSingleSwiftFileTestProject(
2125
"""
2226
import Observation

Tests/SourceKitLSPTests/SwiftPMIntegrationTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,13 @@ final class SwiftPMIntegrationTests: XCTestCase {
185185
}
186186

187187
func testNestedPackage() async throws {
188+
#if os(Windows)
189+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
190+
try XCTSkipIf(
191+
true,
192+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
193+
)
194+
#endif
188195
let project = try await MultiFileTestProject(files: [
189196
"pkg/Sources/lib/lib.swift": "",
190197
"pkg/Package.swift": """

Tests/SourceKitLSPTests/WorkspaceSymbolsTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ import XCTest
1616

1717
class WorkspaceSymbolsTests: XCTestCase {
1818
func testWorkspaceSymbolsAcrossPackages() async throws {
19+
#if os(Windows)
20+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
21+
try XCTSkipIf(
22+
true,
23+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
24+
)
25+
#endif
1926
let project = try await MultiFileTestProject(
2027
files: [
2128
"packageA/Sources/PackageALib/PackageALib.swift": """

Tests/SourceKitLSPTests/WorkspaceTests.swift

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ import XCTest
2323
final class WorkspaceTests: XCTestCase {
2424

2525
func testMultipleSwiftPMWorkspaces() async throws {
26+
#if os(Windows)
27+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
28+
try XCTSkipIf(
29+
true,
30+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
31+
)
32+
#endif
2633
// The package manifest is the same for both packages we open.
2734
let packageManifest = """
2835
// swift-tools-version: 5.7
@@ -159,6 +166,13 @@ final class WorkspaceTests: XCTestCase {
159166
}
160167

161168
func testOpenPackageManifestInMultiSwiftPMWorkspaceSetup() async throws {
169+
#if os(Windows)
170+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
171+
try XCTSkipIf(
172+
true,
173+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
174+
)
175+
#endif
162176
let project = try await MultiFileTestProject(
163177
files: [
164178
// PackageA
@@ -235,6 +249,13 @@ final class WorkspaceTests: XCTestCase {
235249
}
236250

237251
func testSwiftPMPackageInSubfolder() async throws {
252+
#if os(Windows)
253+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
254+
try XCTSkipIf(
255+
true,
256+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
257+
)
258+
#endif
238259
let packageManifest = """
239260
// swift-tools-version: 5.7
240261
@@ -314,6 +335,13 @@ final class WorkspaceTests: XCTestCase {
314335
}
315336

316337
func testNestedSwiftPMWorkspacesWithoutDedicatedWorkspaceFolder() async throws {
338+
#if os(Windows)
339+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
340+
try XCTSkipIf(
341+
true,
342+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
343+
)
344+
#endif
317345
// The package manifest is the same for both packages we open.
318346
let packageManifest = """
319347
// swift-tools-version: 5.7
@@ -496,6 +524,13 @@ final class WorkspaceTests: XCTestCase {
496524
}
497525

498526
func testRecomputeFileWorkspaceMembershipOnPackageSwiftChange() async throws {
527+
#if os(Windows)
528+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
529+
try XCTSkipIf(
530+
true,
531+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
532+
)
533+
#endif
499534
let project = try await MultiFileTestProject(
500535
files: [
501536
"PackageA/Sources/MyLibrary/libA.swift": "",
@@ -625,6 +660,13 @@ final class WorkspaceTests: XCTestCase {
625660
}
626661

627662
func testChangeWorkspaceFolders() async throws {
663+
#if os(Windows)
664+
// FIXME: Enable when https://github.com/swiftlang/swift-package-manager/issues/8038 is fixed
665+
try XCTSkipIf(
666+
true,
667+
"SwiftPM tests fail nondeterministically due to https://github.com/swiftlang/swift-package-manager/issues/8038"
668+
)
669+
#endif
628670
let project = try await MultiFileTestProject(
629671
files: [
630672
"subdir/Sources/otherPackage/otherPackage.swift": """

0 commit comments

Comments
 (0)