Disable DevTools when running the hot restart integration test in flutter_tools (#153247)

When DevTools is active HotRunner.attach makes a deferred RPC to a DevTools service.  That RPC appears to cause issues if it executes at the wrong time during the hot restart.

Passing the --no-devtools flag works around this by disabling the RPC.

See https://github.com/flutter/flutter/issues/153049
This commit is contained in:
Jason Simmons 2024-08-12 12:57:22 -07:00 committed by GitHub
parent dae3a87d93
commit 5a04b4dda9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -81,7 +81,7 @@ void main() {
}); });
testWithoutContext('hot restart works without error', () async { testWithoutContext('hot restart works without error', () async {
await flutter.run(verbose: true); await flutter.run(verbose: true, noDevtools: true);
await flutter.hotRestart(); await flutter.hotRestart();
}); });

View File

@ -510,6 +510,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
bool expressionEvaluation = true, bool expressionEvaluation = true,
bool structuredErrors = false, bool structuredErrors = false,
bool serveObservatory = false, bool serveObservatory = false,
bool noDevtools = false,
bool verbose = false, bool verbose = false,
String? script, String? script,
List<String>? additionalCommandArgs, List<String>? additionalCommandArgs,
@ -521,6 +522,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
'--disable-service-auth-codes', '--disable-service-auth-codes',
'--machine', '--machine',
if (!spawnDdsInstance) '--no-dds', if (!spawnDdsInstance) '--no-dds',
if (noDevtools) '--no-devtools',
'--${serveObservatory ? '' : 'no-'}serve-observatory', '--${serveObservatory ? '' : 'no-'}serve-observatory',
...getLocalEngineArguments(), ...getLocalEngineArguments(),
'-d', '-d',