Skip to content

Commit

Permalink
Update watcher and remove related failingTest() annotation
Browse files Browse the repository at this point in the history
This updates the watcher package to include a fix for the `ready` Future not completing for non-existent folders on Windows:

dart-lang/watcher#157

This fixes a bug where the analyzer would wait indefinitely during initialisation if the workspace contained a folder that did not existing on disk (such as if you have a .code-workspace containing folders and one was subsequently deleted).

Fixes #54116

Change-Id: If283403681080477e497fe7e17f2faa217a5a643
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
DanTup authored and Commit Queue committed Dec 2, 2023
1 parent 1c1bcf7 commit 51d46fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ vars = {
"typed_data_rev": "0b16bd26c90bc9ac08e8b4b259aa3d7bead34feb",
"usage_rev": "e99690ae6d5fa9ec24ac5218bcd3621e8e3ae8a9",
"vector_math_rev": "cca3cf191628bce5354a5989ae61261837ceabfc",
"watcher_rev": "6ac67f18d7f3a0eea728c45ea16993bdfb91ea42",
"watcher_rev": "dc45f1925f66743ff29b9dcbb4693a7ec25945c5",
"web_rev": "cffc2e3d80591c3ddf536f27a7f2fce49ff45e7d",
"web_socket_channel_rev": "5241175e7c66271850d6e75fb9ec90068f9dd3c4", # https://github.com/dart-lang/sdk/issues/54165
"webdev_rev": "63e09e5060813a971ec0f95472613d6958f75b95",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:io';

import 'package:analyzer/src/test_utilities/test_code_format.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
Expand Down Expand Up @@ -85,21 +83,7 @@ linter:

/// Ensure we get diagnostics for a project even if the workspace contains
/// another folder that does not exist.
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/54116')
Future<void> test_workspaceFolders_existsAndDoesNotExist() async {
if (!Platform.isWindows) {
// IF THIS TEST STARTS FAILING...
//
// This test is (at the time of writing) expected to fail on Windows. It
// passes on other platforms so we explicitly fail here for consistency.
//
// If the Windows bot start failing (because the issue is fixed and the
// test is now passing on Windows), this conditional code block should be
// removed, along with the .timeout() further down.
fail('Forced failure for non-Windows so we can detect when the Windows '
'issue is fixed');
}

final rootPath = projectFolderUri.toFilePath();
final existingFolderUri = Uri.file(pathContext.join(rootPath, 'exists'));
final existingFileUri =
Expand All @@ -115,11 +99,7 @@ linter:
await initialize(
workspaceFolders: [existingFolderUri, nonExistingFolderUri]);

// The .timeout() is to ensure this test fails in a way that @FailingTest
// supports and does not just time out. This timeout should be removed
// when the test is passing.
final diagnostics =
await diagnosticsFuture.timeout(const Duration(seconds: 10));
final diagnostics = await diagnosticsFuture;
expect(diagnostics, hasLength(1));
expect(diagnostics!.single.code, 'undefined_class');
}
Expand Down

0 comments on commit 51d46fd

Please sign in to comment.