mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:07:49 +00:00
Make some pkg tests less timing-dependent.
Testing should not depend on how long it takes to get a response from the analysis server. Depending on how long an analysis step takes, these tests will randomly fail e.g. when run in -mdebug mode, or with other VM flags that change (i.e. slow-down) timing (--trace-compiler, --optimization-counter-threshold=5" There are probably more problematic places like this. I just fixed the ones that I saw failing when running with --optimization-counter-threshold=5. BUG=#26556 R=scheglov@google.com Review URL: https://codereview.chromium.org/2016993004 .
This commit is contained in:
parent
e5597652f8
commit
2a6847de41
|
@ -338,12 +338,12 @@ import "../foo/foo.dart";
|
|||
subscriptions[service] = <String>[bar.path].toSet();
|
||||
}
|
||||
server.setAnalysisSubscriptions(subscriptions);
|
||||
await pumpEventQueue(1000);
|
||||
await server.onAnalysisComplete;
|
||||
expect(server.statusAnalyzing, isFalse);
|
||||
channel.notificationsReceived.clear();
|
||||
server.updateContent(
|
||||
'0', {bar.path: new AddContentOverlay('library bar; void f() {}')});
|
||||
await pumpEventQueue(1000);
|
||||
await server.onAnalysisComplete;
|
||||
expect(server.statusAnalyzing, isFalse);
|
||||
expect(channel.notificationsReceived, isNotEmpty);
|
||||
Set<String> notificationTypesReceived = new Set<String>();
|
||||
|
|
|
@ -249,9 +249,6 @@ class MockServerChannel implements ServerCommunicationChannel {
|
|||
|
||||
Future<Response> waitForResponse(Request request) {
|
||||
String id = request.id;
|
||||
pumpEventQueue().then((_) {
|
||||
responseController.addError(new NoResponseException(request));
|
||||
});
|
||||
return new Future<Response>(() =>
|
||||
responseController.stream.firstWhere((response) => response.id == id));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue