diff --git a/pkg/analysis_server/benchmark/perf/memory_tests.dart b/pkg/analysis_server/benchmark/perf/memory_tests.dart index 2d9e01e86c4..7c8ac58f334 100644 --- a/pkg/analysis_server/benchmark/perf/memory_tests.dart +++ b/pkg/analysis_server/benchmark/perf/memory_tests.dart @@ -59,7 +59,7 @@ class AnalysisServerMemoryUsageTest /** * The server is automatically started before every test. - */ + */ @override Future setUp({bool useCFE: false}) { onAnalysisErrors.listen((AnalysisErrorsParams params) { @@ -74,11 +74,7 @@ class AnalysisServerMemoryUsageTest outOfTestExpect(serverConnected.isCompleted, isFalse); serverConnected.complete(); }); - return startServer( - servicesPort: vmServicePort, - cfe: useCFE, - checked: false, - ).then((_) { + return startServer(servicesPort: vmServicePort, cfe: useCFE).then((_) { server.listenToOutput(dispatchNotification); server.exitCode.then((_) { skipShutdown = true; diff --git a/pkg/analysis_server/test/integration/analysis/get_errors_nonStandard_sdk.dart b/pkg/analysis_server/test/integration/analysis/get_errors_nonStandard_sdk.dart index d992b668240..d58a04397cb 100644 --- a/pkg/analysis_server/test/integration/analysis/get_errors_nonStandard_sdk.dart +++ b/pkg/analysis_server/test/integration/analysis/get_errors_nonStandard_sdk.dart @@ -70,14 +70,9 @@ class AnalysisDomainGetErrorsTest } @override - Future startServer( - {bool checked: true, - int diagnosticPort, - int servicesPort, - bool cfe: false}) { + Future startServer({int diagnosticPort, int servicesPort, bool cfe: false}) { String sdkPath = createNonStandardSdk(); return server.start( - checked: checked, diagnosticPort: diagnosticPort, sdkPath: sdkPath, servicesPort: servicesPort, diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test2.dart b/pkg/analysis_server/test/integration/analysis/highlights_test2.dart index 5f4a9c390e3..86e5917e333 100644 --- a/pkg/analysis_server/test/integration/analysis/highlights_test2.dart +++ b/pkg/analysis_server/test/integration/analysis/highlights_test2.dart @@ -21,13 +21,11 @@ main() { @reflectiveTest class AnalysisHighlightsTest extends AbstractAnalysisServerIntegrationTest { Future startServer({ - bool checked: true, int diagnosticPort, int servicesPort, bool cfe: false, }) { return server.start( - checked: checked, diagnosticPort: diagnosticPort, servicesPort: servicesPort, useAnalysisHighlight2: true, diff --git a/pkg/analysis_server/test/integration/support/integration_tests.dart b/pkg/analysis_server/test/integration/support/integration_tests.dart index db7ff54f30d..97527b10e0b 100644 --- a/pkg/analysis_server/test/integration/support/integration_tests.dart +++ b/pkg/analysis_server/test/integration/support/integration_tests.dart @@ -263,13 +263,11 @@ abstract class AbstractAnalysisServerIntegrationTest * Start [server]. */ Future startServer({ - bool checked: true, int diagnosticPort, int servicesPort, bool cfe: false, }) { return server.start( - checked: checked, diagnosticPort: diagnosticPort, servicesPort: servicesPort, useCFE: cfe || useCFE); @@ -664,7 +662,6 @@ class Server { * to be used. */ Future start({ - bool checked: true, int diagnosticPort, String instrumentationLogFile, bool profileServer: false, @@ -678,9 +675,28 @@ class Server { } _time.start(); String dartBinary = Platform.executable; - String rootDir = - findRoot(Platform.script.toFilePath(windows: Platform.isWindows)); - String serverPath = normalize(join(rootDir, 'bin', 'server.dart')); + + // The integration tests run 3x faster when run from snapshots (you need to + // run test.py with --use-sdk). + final bool useSnapshot = true; + String serverPath; + + if (useSnapshot) { + // Look for snapshots/analysis_server.dart.snapshot. + serverPath = normalize(join(dirname(Platform.resolvedExecutable), + 'snapshots', 'analysis_server.dart.snapshot')); + + if (!FileSystemEntity.isFileSync(serverPath)) { + // Look for dart-sdk/bin/snapshots/analysis_server.dart.snapshot. + serverPath = normalize(join(dirname(Platform.resolvedExecutable), + 'dart-sdk', 'bin', 'snapshots', 'analysis_server.dart.snapshot')); + } + } else { + String rootDir = + findRoot(Platform.script.toFilePath(windows: Platform.isWindows)); + serverPath = normalize(join(rootDir, 'bin', 'server.dart')); + } + List arguments = []; // // Add VM arguments. @@ -701,9 +717,6 @@ class Server { if (Platform.packageConfig != null) { arguments.add('--packages=${Platform.packageConfig}'); } - if (checked) { - arguments.add('--checked'); - } // // Add the server executable. //