| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test.integration.analysis; | 5 library test.integration.analysis; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| 11 | 11 |
| 12 import 'package:analysis_server/src/constants.dart'; | 12 import 'package:analysis_server/src/constants.dart'; |
| 13 import 'package:path/path.dart'; | 13 import 'package:path/path.dart'; |
| 14 import 'package:unittest/unittest.dart'; | 14 import 'package:unittest/unittest.dart'; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Base class for analysis server integration tests. | 17 * Base class for analysis server integration tests. |
| 18 */ | 18 */ |
| 19 abstract class AbstractAnalysisServerIntegrationTest { | 19 abstract class AbstractAnalysisServerIntegrationTest { |
| 20 /** | 20 /** |
| 21 * Amount of time to give the server to respond to a shutdown request before | 21 * Amount of time to give the server to respond to a shutdown request before |
| 22 * forcibly terminating it. | 22 * forcibly terminating it. |
| 23 * |
| 24 * TODO(paulberry): the extra-long timeout (20s) is because sometimes the |
| 25 * buildbots are slow to spawn a new analysis server process. It would be |
| 26 * better to wait for the initial "server.connected" message with a long |
| 27 * timeout, and keep this timeout short. |
| 28 * |
| 23 */ | 29 */ |
| 24 static const Duration SHUTDOWN_TIMEOUT = const Duration(seconds: 5); | 30 static const Duration SHUTDOWN_TIMEOUT = const Duration(seconds: 20); |
| 25 | 31 |
| 26 /** | 32 /** |
| 27 * Connection to the analysis server. | 33 * Connection to the analysis server. |
| 28 */ | 34 */ |
| 29 Server server; | 35 Server server; |
| 30 | 36 |
| 31 /** | 37 /** |
| 32 * Temporary directory in which source files can be stored. | 38 * Temporary directory in which source files can be stored. |
| 33 */ | 39 */ |
| 34 Directory sourceDirectory; | 40 Directory sourceDirectory; |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 void _recordStdio(String line) { | 717 void _recordStdio(String line) { |
| 712 double elapsedTime = _time.elapsedTicks.toDouble() / | 718 double elapsedTime = _time.elapsedTicks.toDouble() / |
| 713 _time.frequency.toDouble(); | 719 _time.frequency.toDouble(); |
| 714 line = "$elapsedTime: $line"; | 720 line = "$elapsedTime: $line"; |
| 715 if (_debuggingStdio) { | 721 if (_debuggingStdio) { |
| 716 print(line); | 722 print(line); |
| 717 } | 723 } |
| 718 _recordedStdio.add(line); | 724 _recordedStdio.add(line); |
| 719 } | 725 } |
| 720 } | 726 } |
| OLD | NEW |