Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1138)

Unified Diff: runtime/observatory/tests/service/test_helper.dart

Issue 1664273002: Turn on service tracing for all service tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/test_helper.dart
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart
index 794cecd8e96635c6a6ae519361ffdc2c957761ac..1adcd6648b16315dcbefc256866e2f763fef144b 100644
--- a/runtime/observatory/tests/service/test_helper.dart
+++ b/runtime/observatory/tests/service/test_helper.dart
@@ -33,6 +33,9 @@ class _TestLauncher {
assert(pause_on_start != null);
assert(pause_on_exit != null);
assert(trace_service != null);
+ // TODO(turnidge): I have temporarily turned on service tracing for
+ // all tests to help diagnose flaky tests.
+ trace_service = true;
String dartExecutable = Platform.executable;
var fullArgs = [];
if (trace_service) {
@@ -280,40 +283,9 @@ Future<Isolate> hasStoppedWithUnhandledException(Isolate isolate) {
}
Future<Isolate> hasPausedAtStart(Isolate isolate) {
- // Set up a listener to wait for breakpoint events.
- Completer completer = new Completer();
- isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
- var subscription;
- subscription = stream.listen((ServiceEvent event) {
- if (event.kind == ServiceEvent.kPauseStart) {
- print('Paused at isolate start');
- subscription.cancel();
- if (completer != null) {
- // Reload to update isolate.pauseEvent.
- completer.complete(isolate.reload());
- completer = null;
- }
- }
- });
-
- // Pause may have happened before we subscribed.
- isolate.reload().then((_) {
- if ((isolate.pauseEvent != null) &&
- (isolate.pauseEvent.kind == ServiceEvent.kPauseStart)) {
- print('Paused at isolate start');
- subscription.cancel();
- if (completer != null) {
- completer.complete(isolate);
- completer = null;
- }
- }
- });
- });
-
- return completer.future;
+ return hasPausedFor(isolate, ServiceEvent.kPauseStart);
}
-
// Currying is your friend.
IsolateTest setBreakpointAtLine(int line) {
return (Isolate isolate) async {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698