diff --git a/packages/flutter_tools/lib/src/base/dds.dart b/packages/flutter_tools/lib/src/base/dds.dart index 6a5ece2c29..39cdd67161 100644 --- a/packages/flutter_tools/lib/src/base/dds.dart +++ b/packages/flutter_tools/lib/src/base/dds.dart @@ -96,22 +96,11 @@ class DartDevelopmentService with DartDevelopmentServiceLocalOperationsMixin { Artifact.engineDartBinary, ), ); - - // Complete the future if the DDS process is null, which happens in - // testing. unawaited(_ddsInstance!.done.whenComplete(completeFuture)); } on DartDevelopmentServiceException catch (e) { _logger.printTrace('Warning: Failed to start DDS: ${e.message}'); if (e is ExistingDartDevelopmentServiceException) { _existingDdsUri = e.ddsUri; - } else { - _logger.printError( - 'DDS has failed to start and there is not an existing DDS instance ' - 'available to connect to. Please file an issue at https://github.com/flutter/flutter/issues ' - 'with the following error message:\n\n ${e.message}.'); - // DDS was unable to start for an unknown reason. Raise a StateError - // so it can be reported by the crash reporter. - throw StateError(e.message); } completeFuture(); rethrow; diff --git a/packages/flutter_tools/test/general.shard/resident_runner_test.dart b/packages/flutter_tools/test/general.shard/resident_runner_test.dart index 545c6d4294..275a5b6f24 100644 --- a/packages/flutter_tools/test/general.shard/resident_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_runner_test.dart @@ -2021,65 +2021,6 @@ flutter: }) async => FakeVmServiceHost(requests: []).vmService, })); - testUsingContext('Failed DDS start outputs error message', () => testbed.run(() async { - // See https://github.com/flutter/flutter/issues/72385 for context. - final FakeDevice device = FakeDevice() - ..dds = DartDevelopmentService(logger: testLogger); - ddsLauncherCallback = ({ - required Uri remoteVmServiceUri, - Uri? serviceUri, - bool enableAuthCodes = true, - bool serveDevTools = false, - Uri? devToolsServerAddress, - bool enableServicePortFallback = false, - List cachedUserTags = const [], - String? dartExecutable, - String? google3WorkspaceRoot, - }) { - expect(remoteVmServiceUri, Uri(scheme: 'foo', host: 'bar')); - expect(enableAuthCodes, isTrue); - expect(serviceUri, Uri(scheme: 'http', host: '127.0.0.1', port: 0)); - expect(cachedUserTags, isEmpty); - throw FakeDartDevelopmentServiceException(message: 'No URI'); - }; - final TestFlutterDevice flutterDevice = TestFlutterDevice( - device, - vmServiceUris: Stream.value(testUri), - ); - bool caught = false; - final Completerdone = Completer(); - runZonedGuarded(() { - flutterDevice.connect( - allowExistingDdsInstance: true, - debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug, enableDevTools: false), - ).then((_) => done.complete()); - }, (Object e, StackTrace st) { - expect(e, isA()); - expect((e as StateError).message, contains('No URI')); - expect(testLogger.errorText, contains( - 'DDS has failed to start and there is not an existing DDS instance', - )); - done.complete(); - caught = true; - }); - await done.future; - if (!caught) { - fail('Expected a StateError to be thrown.'); - } - }, overrides: { - VMServiceConnector: () => (Uri httpUri, { - ReloadSources? reloadSources, - Restart? restart, - CompileExpression? compileExpression, - GetSkSLMethod? getSkSLMethod, - FlutterProject? flutterProject, - PrintStructuredErrorLogMethod? printStructuredErrorLogMethod, - io.CompressionOptions compression = io.CompressionOptions.compressionDefault, - Device? device, - required Logger logger, - }) async => FakeVmServiceHost(requests: []).vmService, - })); - testUsingContext('nextPlatform moves through expected platforms', () { expect(nextPlatform('android'), 'iOS'); expect(nextPlatform('iOS'), 'windows');