mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
Disable a test to fix the bots (TBR)
Review-Url: https://codereview.chromium.org/2946763002 .
This commit is contained in:
parent
72e1775fd1
commit
d30c5070a2
|
@ -41,6 +41,55 @@ class AnalysisServerTest {
|
|||
MemoryResourceProvider resourceProvider;
|
||||
MockPackageMapProvider packageMapProvider;
|
||||
|
||||
/**
|
||||
* Test that having multiple analysis contexts analyze the same file doesn't
|
||||
* cause that file to receive duplicate notifications when it's modified.
|
||||
*/
|
||||
Future do_not_test_no_duplicate_notifications() async {
|
||||
// Subscribe to STATUS so we'll know when analysis is done.
|
||||
server.serverServices = [ServerService.STATUS].toSet();
|
||||
resourceProvider.newFolder('/foo');
|
||||
resourceProvider.newFolder('/bar');
|
||||
resourceProvider.newFile('/foo/foo.dart', 'import "../bar/bar.dart";');
|
||||
File bar = resourceProvider.newFile('/bar/bar.dart', 'library bar;');
|
||||
server.setAnalysisRoots('0', ['/foo', '/bar'], [], {});
|
||||
Map<AnalysisService, Set<String>> subscriptions =
|
||||
<AnalysisService, Set<String>>{};
|
||||
for (AnalysisService service in AnalysisService.VALUES) {
|
||||
subscriptions[service] = <String>[bar.path].toSet();
|
||||
}
|
||||
// The following line causes the isolate to continue running even though the
|
||||
// test completes.
|
||||
server.setAnalysisSubscriptions(subscriptions);
|
||||
await server.onAnalysisComplete;
|
||||
expect(server.statusAnalyzing, isFalse);
|
||||
channel.notificationsReceived.clear();
|
||||
server.updateContent(
|
||||
'0', {bar.path: new AddContentOverlay('library bar; void f() {}')});
|
||||
await server.onAnalysisComplete;
|
||||
expect(server.statusAnalyzing, isFalse);
|
||||
expect(channel.notificationsReceived, isNotEmpty);
|
||||
Set<String> notificationTypesReceived = new Set<String>();
|
||||
for (Notification notification in channel.notificationsReceived) {
|
||||
String notificationType = notification.event;
|
||||
switch (notificationType) {
|
||||
case 'server.status':
|
||||
case 'analysis.errors':
|
||||
// It's normal for these notifications to be sent multiple times.
|
||||
break;
|
||||
case 'analysis.outline':
|
||||
// It's normal for this notification to be sent twice.
|
||||
// TODO(paulberry): why?
|
||||
break;
|
||||
default:
|
||||
if (!notificationTypesReceived.add(notificationType)) {
|
||||
fail('Notification type $notificationType received more than once');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void processRequiredPlugins(ServerPlugin serverPlugin) {
|
||||
List<Plugin> plugins = <Plugin>[];
|
||||
plugins.addAll(AnalysisEngine.instance.requiredPlugins);
|
||||
|
@ -79,53 +128,6 @@ class AnalysisServerTest {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that having multiple analysis contexts analyze the same file doesn't
|
||||
* cause that file to receive duplicate notifications when it's modified.
|
||||
*/
|
||||
Future test_no_duplicate_notifications() async {
|
||||
// Subscribe to STATUS so we'll know when analysis is done.
|
||||
server.serverServices = [ServerService.STATUS].toSet();
|
||||
resourceProvider.newFolder('/foo');
|
||||
resourceProvider.newFolder('/bar');
|
||||
resourceProvider.newFile('/foo/foo.dart', 'import "../bar/bar.dart";');
|
||||
File bar = resourceProvider.newFile('/bar/bar.dart', 'library bar;');
|
||||
server.setAnalysisRoots('0', ['/foo', '/bar'], [], {});
|
||||
Map<AnalysisService, Set<String>> subscriptions =
|
||||
<AnalysisService, Set<String>>{};
|
||||
for (AnalysisService service in AnalysisService.VALUES) {
|
||||
subscriptions[service] = <String>[bar.path].toSet();
|
||||
}
|
||||
server.setAnalysisSubscriptions(subscriptions);
|
||||
await server.onAnalysisComplete;
|
||||
expect(server.statusAnalyzing, isFalse);
|
||||
channel.notificationsReceived.clear();
|
||||
server.updateContent(
|
||||
'0', {bar.path: new AddContentOverlay('library bar; void f() {}')});
|
||||
await server.onAnalysisComplete;
|
||||
expect(server.statusAnalyzing, isFalse);
|
||||
expect(channel.notificationsReceived, isNotEmpty);
|
||||
Set<String> notificationTypesReceived = new Set<String>();
|
||||
for (Notification notification in channel.notificationsReceived) {
|
||||
String notificationType = notification.event;
|
||||
switch (notificationType) {
|
||||
case 'server.status':
|
||||
case 'analysis.errors':
|
||||
// It's normal for these notifications to be sent multiple times.
|
||||
break;
|
||||
case 'analysis.outline':
|
||||
// It's normal for this notification to be sent twice.
|
||||
// TODO(paulberry): why?
|
||||
break;
|
||||
default:
|
||||
if (!notificationTypesReceived.add(notificationType)) {
|
||||
fail('Notification type $notificationType received more than once');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void test_rethrowExceptions() {
|
||||
Exception exceptionToThrow = new Exception('test exception');
|
||||
MockServerOperation operation =
|
||||
|
|
Loading…
Reference in a new issue