Unverified Commit 5a36bddd authored by Ben Konyi's avatar Ben Konyi Committed by GitHub

Stop serving Observatory by default (#122419)

Observatory can still be enabled by providing `--serve-observatory` or
invoking the `_serveObservatory` private service RPC via web socket or
HTTP.

Related to https://github.com/dart-lang/sdk/issues/50233
parent 897e3db4
...@@ -937,7 +937,7 @@ class DebuggingOptions { ...@@ -937,7 +937,7 @@ class DebuggingOptions {
this.nativeNullAssertions = false, this.nativeNullAssertions = false,
this.enableImpeller = ImpellerStatus.platformDefault, this.enableImpeller = ImpellerStatus.platformDefault,
this.uninstallFirst = false, this.uninstallFirst = false,
this.serveObservatory = true, this.serveObservatory = false,
this.enableDartProfiling = true, this.enableDartProfiling = true,
this.enableEmbedderApi = false, this.enableEmbedderApi = false,
}) : debuggingEnabled = true; }) : debuggingEnabled = true;
......
...@@ -474,7 +474,6 @@ abstract class FlutterCommand extends Command<void> { ...@@ -474,7 +474,6 @@ abstract class FlutterCommand extends Command<void> {
void addServeObservatoryOptions({required bool verboseHelp}) { void addServeObservatoryOptions({required bool verboseHelp}) {
argParser.addFlag('serve-observatory', argParser.addFlag('serve-observatory',
hide: !verboseHelp, hide: !verboseHelp,
defaultsTo: true,
help: 'Serve the legacy Observatory developer tooling through the VM service.', help: 'Serve the legacy Observatory developer tooling through the VM service.',
); );
} }
......
...@@ -197,24 +197,22 @@ void main() { ...@@ -197,24 +197,22 @@ void main() {
testWithoutContext('enables Observatory on run', () async { testWithoutContext('enables Observatory on run', () async {
await flutterRun.run( await flutterRun.run(
withDebugger: true, withDebugger: true,
// TODO(bkonyi): uncomment once Observatory is disabled by default serveObservatory: true,
// See https://github.com/dart-lang/sdk/issues/50233
// serveObservatory: true,
); );
expect(await isObservatoryAvailable(), true); expect(await isObservatoryAvailable(), true);
}); });
testWithoutContext('enables Observatory on attach', () async { testWithoutContext('enables Observatory on attach', () async {
await flutterRun.run(withDebugger: true, serveObservatory: false); await flutterRun.run(withDebugger: true);
// Bail out if Observatory is still served by default in the VM. // Bail out if Observatory is still served by default in the VM.
// TODO(bkonyi): replace this with the following once Observatory is disabled in the VM:
// expect(await isObservatoryAvailable(), isFalse);
if (await isObservatoryAvailable()) { if (await isObservatoryAvailable()) {
return; return;
} }
await flutterAttach.attach( await flutterAttach.attach(
flutterRun.vmServicePort!, flutterRun.vmServicePort!,
// TODO(bkonyi): uncomment once Observatory is disabled by default serveObservatory: true,
// See https://github.com/dart-lang/sdk/issues/50233
// serveObservatory: true,
); );
expect(await isObservatoryAvailable(), true); expect(await isObservatoryAvailable(), true);
}); });
......
...@@ -505,7 +505,7 @@ class FlutterRunTestDriver extends FlutterTestDriver { ...@@ -505,7 +505,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
bool expressionEvaluation = true, bool expressionEvaluation = true,
bool structuredErrors = false, bool structuredErrors = false,
bool singleWidgetReloads = false, bool singleWidgetReloads = false,
bool serveObservatory = true, bool serveObservatory = false,
String? script, String? script,
List<String>? additionalCommandArgs, List<String>? additionalCommandArgs,
}) async { }) async {
...@@ -545,7 +545,7 @@ class FlutterRunTestDriver extends FlutterTestDriver { ...@@ -545,7 +545,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
bool startPaused = false, bool startPaused = false,
bool pauseOnExceptions = false, bool pauseOnExceptions = false,
bool singleWidgetReloads = false, bool singleWidgetReloads = false,
bool serveObservatory = true, bool serveObservatory = false,
List<String>? additionalCommandArgs, List<String>? additionalCommandArgs,
}) async { }) async {
_attachPort = port; _attachPort = port;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment