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

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

Issue 2786503003: Fix a couple of bugs with async stack traces (Closed)
Patch Set: update dartk service test status Created 3 years, 9 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
Index: runtime/observatory/tests/service/regress_28980_test.dart
diff --git a/runtime/observatory/tests/service/regress_28443_test.dart b/runtime/observatory/tests/service/regress_28980_test.dart
similarity index 63%
copy from runtime/observatory/tests/service/regress_28443_test.dart
copy to runtime/observatory/tests/service/regress_28980_test.dart
index 411c8370097edbf61de55e41f6d7f12291001d79..79eb64449a2dcf1437ea57ee2ffab6caf392581a 100644
--- a/runtime/observatory/tests/service/regress_28443_test.dart
+++ b/runtime/observatory/tests/service/regress_28980_test.dart
@@ -8,34 +8,42 @@ import 'service_test_common.dart';
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
-const int LINE_A = 28, LINE_B = 33;
+const int LINE_A = 19, LINE_B = 38;
-class VMServiceClient {
- VMServiceClient(this.x);
- close() => new Future.microtask(() => print("close"));
- var x;
+var _lock;
+var _lockEnabled = true;
+
+String flutterRoot = "abc";
+
+foo(a, b, c, d) {
+ return new A(); // LINE_A
}
-collect() async {
- var uri = "abc";
- var vmService;
- await new Future.microtask(() async {
- try {
- vmService = new VMServiceClient(uri);
- await new Future.microtask(() => throw new TimeoutException("here"));
- } on dynamic {
- vmService.close();
- rethrow; // LINE_A
- }
- });
+class A {
+ Future lock() => new Future.microtask(() => print("lock"));
+ String path = "path";
}
-test_code() async {
- // LINE_B
- try {
- await collect();
- } on TimeoutException {
- print("ok");
+class FileSystemException {}
+
+Future<Null> test_code() async {
+ if (!_lockEnabled) return null;
+ assert(_lock == null);
+ _lock = foo(flutterRoot, 'bin', 'cache', 'lockfile');
+ bool locked = false;
+ bool printed = false;
+ while (!locked) {
+ try {
+ await _lock.lock();
+ locked = true; // LINE_B
+ } on FileSystemException {
+ if (!printed) {
+ printTrace('Print path: ${_lock.path}');
+ printStatus('Just another line...');
+ printed = true;
+ }
+ await new Future<Null>.delayed(const Duration(milliseconds: 50));
+ }
}
}
@@ -64,15 +72,16 @@ Future<Isolate> stepThroughProgram(Isolate isolate) async {
var tests = [
hasPausedAtStart,
markDartColonLibrariesDebuggable,
- setBreakpointAtLine(LINE_B),
+ setBreakpointAtLine(LINE_A),
resumeIsolate,
hasStoppedAtBreakpoint,
- setBreakpointAtLine(LINE_A),
+ setBreakpointAtLine(LINE_B),
resumeIsolate,
hasStoppedAtBreakpoint,
- stepOut,
- stoppedAtLine(LINE_B),
- resumeIsolate
+ stepInto,
+ stepInto,
+ stepInto,
+ resumeIsolate,
];
main(args) => runIsolateTestsSynchronous(args, tests,
« no previous file with comments | « runtime/observatory/tests/service/regress_28443_test.dart ('k') | runtime/observatory/tests/service/service.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698