Skip to content

Commit eec5969

Browse files
authored
Disable flakey diagnostics tests in Swift 5.6 and below (#1127)
It appears there is an issue in Swift 5.6 where a line of diagnostics output is improperly cleared from the terminal by the build progress prints. When this happens the tests potentially miss diagnostics they expect to see. This only happens on Swift 5.6, so to ensure these tests pass consistently, skip them there.
1 parent d8e7670 commit eec5969

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

test/integration-tests/DiagnosticsManager.test.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,14 @@ suite("DiagnosticsManager Test Suite", async function () {
216216
assertHasDiagnostic(funcUri, expectedFuncErrorDiagnostic);
217217
}).timeout(2 * 60 * 1000); // Allow 2 minutes to build
218218

219-
test("Parses C diagnostics", async () => {
219+
test("Parses C diagnostics", async function () {
220+
const swiftVersion = workspaceContext.toolchain.swiftVersion;
221+
// SPM will sometimes improperly clear diagnostics from the terminal, leading
222+
// to a flakey test.
223+
if (swiftVersion.isLessThan(new Version(5, 7, 0))) {
224+
this.skip();
225+
}
226+
220227
await swiftConfig.update("diagnosticsStyle", "llvm");
221228
const task = createBuildAllTask(cFolderContext);
222229
// Run actual task
@@ -243,7 +250,14 @@ suite("DiagnosticsManager Test Suite", async function () {
243250
assertHasDiagnostic(cUri, expectedDiagnostic2);
244251
});
245252

246-
test("Parses C++ diagnostics", async () => {
253+
test("Parses C++ diagnostics", async function () {
254+
const swiftVersion = workspaceContext.toolchain.swiftVersion;
255+
// SPM will sometimes improperly clear diagnostics from the terminal, leading
256+
// to a flakey test.
257+
if (swiftVersion.isLessThan(new Version(5, 7, 0))) {
258+
this.skip();
259+
}
260+
247261
await swiftConfig.update("diagnosticsStyle", "llvm");
248262
const task = createBuildAllTask(cppFolderContext);
249263
// Run actual task

0 commit comments

Comments
 (0)