add more print traces in hot runner workflow (#148258)
In service of https://github.com/flutter/flutter/issues/146879. See https://github.com/flutter/flutter/issues/146879#issuecomment-2108784673 in particular for the purpose of this PR. This adds a few more `printTrace` calls to try to see where we are getting stuck.
This commit is contained in:
@@ -172,7 +172,7 @@ class ResidentWebRunner extends ResidentRunner {
|
||||
final vmservice.VmService? service = _connectionResult?.vmService;
|
||||
final Uri websocketUri = Uri.parse(_connectionResult!.debugConnection!.uri);
|
||||
final Uri httpUri = _httpUriFromWebsocketUri(websocketUri);
|
||||
return _instance ??= FlutterVmService(service!, wsAddress: websocketUri, httpAddress: httpUri);
|
||||
return _instance ??= FlutterVmService(service!, wsAddress: websocketUri, httpAddress: httpUri, logger: _logger);
|
||||
}
|
||||
|
||||
FlutterVmService? _instance;
|
||||
|
||||
@@ -417,7 +417,7 @@ Future<FlutterVmService> _connect(
|
||||
// This call is to ensure we are able to establish a connection instead of
|
||||
// keeping on trucking and failing farther down the process.
|
||||
await delegateService.getVersion();
|
||||
return FlutterVmService(service, httpAddress: httpUri, wsAddress: wsUri);
|
||||
return FlutterVmService(service, httpAddress: httpUri, wsAddress: wsUri, logger: logger);
|
||||
}
|
||||
|
||||
String _validateRpcStringParam(String methodName, Map<String, Object?> params, String paramName) {
|
||||
@@ -486,11 +486,13 @@ class FlutterVmService {
|
||||
this.service, {
|
||||
this.wsAddress,
|
||||
this.httpAddress,
|
||||
});
|
||||
required Logger logger,
|
||||
}) : _logger = logger;
|
||||
|
||||
final vm_service.VmService service;
|
||||
final Uri? wsAddress;
|
||||
final Uri? httpAddress;
|
||||
final Logger _logger;
|
||||
|
||||
Future<vm_service.Response?> callMethodWrapper(
|
||||
String method, {
|
||||
@@ -569,6 +571,7 @@ class FlutterVmService {
|
||||
required Uri main,
|
||||
required Uri assetsDirectory,
|
||||
}) async {
|
||||
_logger.printTrace('Running $main in view $viewId...');
|
||||
try {
|
||||
await service.streamListen(vm_service.EventStreams.kIsolate);
|
||||
} on vm_service.RPCError {
|
||||
@@ -577,6 +580,7 @@ class FlutterVmService {
|
||||
final Future<void> onRunnable = service.onIsolateEvent.firstWhere((vm_service.Event event) {
|
||||
return event.kind == vm_service.EventKind.kIsolateRunnable;
|
||||
});
|
||||
_logger.printTrace('Calling $kRunInViewMethod...');
|
||||
await callMethodWrapper(
|
||||
kRunInViewMethod,
|
||||
args: <String, Object>{
|
||||
@@ -585,7 +589,9 @@ class FlutterVmService {
|
||||
'assetDirectory': assetsDirectory.toString(),
|
||||
},
|
||||
);
|
||||
_logger.printTrace('Finished $kRunInViewMethod');
|
||||
await onRunnable;
|
||||
_logger.printTrace('Finished running $main in view $viewId');
|
||||
}
|
||||
|
||||
/// Renders the last frame with additional raster tracing enabled.
|
||||
@@ -905,9 +911,11 @@ class FlutterVmService {
|
||||
Duration delay = const Duration(milliseconds: 50),
|
||||
}) async {
|
||||
while (true) {
|
||||
_logger.printTrace('Calling _flutter.listViews...');
|
||||
final vm_service.Response? response = await callMethodWrapper(
|
||||
kListViewsMethod,
|
||||
);
|
||||
_logger.printTrace('Response from _flutter.listViews: ${json.encode(response?.json)}');
|
||||
if (response == null) {
|
||||
// The service may have disappeared mid-request.
|
||||
// Return an empty list now, and let the shutdown logic elsewhere deal
|
||||
|
||||
@@ -167,7 +167,7 @@ void main() {
|
||||
|
||||
testWithoutContext('setAssetDirectory forwards arguments correctly', () async {
|
||||
final MockVMService mockVMService = MockVMService();
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService);
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService, logger: BufferLogger.test());
|
||||
|
||||
await flutterVmService.setAssetDirectory(
|
||||
assetsDirectory: Uri(path: 'abc', scheme: 'file'),
|
||||
@@ -186,7 +186,7 @@ void main() {
|
||||
|
||||
testWithoutContext('setAssetDirectory forwards arguments correctly - windows', () async {
|
||||
final MockVMService mockVMService = MockVMService();
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService);
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService, logger: BufferLogger.test());
|
||||
|
||||
await flutterVmService.setAssetDirectory(
|
||||
assetsDirectory: Uri(path: 'C:/Users/Tester/AppData/Local/Temp/hello_worldb42a6da5/hello_world/build/flutter_assets', scheme: 'file'),
|
||||
@@ -207,7 +207,7 @@ void main() {
|
||||
|
||||
testWithoutContext('getSkSLs forwards arguments correctly', () async {
|
||||
final MockVMService mockVMService = MockVMService();
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService);
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService, logger: BufferLogger.test());
|
||||
|
||||
await flutterVmService.getSkSLs(viewId: 'abc');
|
||||
|
||||
@@ -220,7 +220,7 @@ void main() {
|
||||
|
||||
testWithoutContext('flushUIThreadTasks forwards arguments correctly', () async {
|
||||
final MockVMService mockVMService = MockVMService();
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService);
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService, logger: BufferLogger.test());
|
||||
|
||||
await flutterVmService.flushUIThreadTasks(uiIsolateId: 'def');
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/convert.dart';
|
||||
import 'package:flutter_tools/src/vmservice.dart';
|
||||
import 'package:test/test.dart' hide test;
|
||||
@@ -22,7 +23,7 @@ class FakeVmServiceHost {
|
||||
_vmService = FlutterVmService(vm_service.VmService(
|
||||
_input.stream,
|
||||
_output.add,
|
||||
), httpAddress: httpAddress, wsAddress: wsAddress);
|
||||
), httpAddress: httpAddress, wsAddress: wsAddress, logger: BufferLogger.test());
|
||||
_applyStreamListen();
|
||||
_output.stream.listen((String data) {
|
||||
final Map<String, Object?> request = json.decode(data) as Map<String, Object?>;
|
||||
|
||||
Reference in New Issue
Block a user