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 {
this.nativeNullAssertions = false,
this.enableImpeller = ImpellerStatus.platformDefault,
this.uninstallFirst = false,
this.serveObservatory = true,
this.serveObservatory = false,
this.enableDartProfiling = true,
this.enableEmbedderApi = false,
}) : debuggingEnabled = true;
......
......@@ -474,7 +474,6 @@ abstract class FlutterCommand extends Command<void> {
void addServeObservatoryOptions({required bool verboseHelp}) {
argParser.addFlag('serve-observatory',
hide: !verboseHelp,
defaultsTo: true,
help: 'Serve the legacy Observatory developer tooling through the VM service.',
);
}
......
......@@ -197,24 +197,22 @@ void main() {
testWithoutContext('enables Observatory on run', () async {
await flutterRun.run(
withDebugger: true,
// TODO(bkonyi): uncomment once Observatory is disabled by default
// See https://github.com/dart-lang/sdk/issues/50233
// serveObservatory: true,
serveObservatory: true,
);
expect(await isObservatoryAvailable(), true);
});
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.
// TODO(bkonyi): replace this with the following once Observatory is disabled in the VM:
// expect(await isObservatoryAvailable(), isFalse);
if (await isObservatoryAvailable()) {
return;
}
await flutterAttach.attach(
flutterRun.vmServicePort!,
// TODO(bkonyi): uncomment once Observatory is disabled by default
// See https://github.com/dart-lang/sdk/issues/50233
// serveObservatory: true,
serveObservatory: true,
);
expect(await isObservatoryAvailable(), true);
});
......
......@@ -505,7 +505,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
bool expressionEvaluation = true,
bool structuredErrors = false,
bool singleWidgetReloads = false,
bool serveObservatory = true,
bool serveObservatory = false,
String? script,
List<String>? additionalCommandArgs,
}) async {
......@@ -545,7 +545,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
bool startPaused = false,
bool pauseOnExceptions = false,
bool singleWidgetReloads = false,
bool serveObservatory = true,
bool serveObservatory = false,
List<String>? additionalCommandArgs,
}) async {
_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