| 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,
|
|
|