anchor.diff:      );
     }
   
  -  // TODO(bkonyi): remove deprecated member usage, https://github.com/flutter/flutter/issues/51951
  -  // ignore: deprecated_member_use
  -  final Future<Packages> _packagesFuture = loadPackagesFile(Uri.base.resolve('.packages'));
  -
  -  final PackageMap _flutterToolsPackageMap = PackageMap(p.join(
  -    Cache.flutterRoot,
  -    'packages',
  -    'flutter_tools',
  -    '.packages',
  -  ), fileSystem: globals.fs);
  +  final Future<PackageConfig> _packagesFuture = loadPackageConfigUri(
  +    Uri.base.resolve('.packages'),
  +    loader: (Uri uri) {
  +      final File file = globals.fs.file(uri);
  +      if (!file.existsSync()) {
  +        return null;
  +      }
  +      return file.readAsBytes();
  +    }
  +  );
  +
  +  final Future<PackageConfig> _flutterToolsPackageMap = loadPackageConfigUri(
  +    globals.fs.file(globals.fs.path.join(
  +      Cache.flutterRoot,
  +      'packages',
  +      'flutter_tools',
  +      '.packages',
  +    )).absolute.uri,
  +      loader: (Uri uri) {
  +        final File file = globals.fs.file(uri);
  +        if (!file.existsSync()) {
  +          return null;
  +        }
  +        return file.readAsBytes();
  +      }
  +    );
   
     /// Uri of the test package.
  -  Uri get testUri => _flutterToolsPackageMap.map['test'];
  +  Future<Uri> get testUri async => (await _flutterToolsPackageMap)['test']?.packageUriRoot;
   
     /// The test runner configuration.
     final Configuration _config;
  
positive.code: import 'package:async/async.dart';
  import 'package:http_multi_server/http_multi_server.dart';
  import 'package:meta/meta.dart';
  // TODO(bkonyi): remove deprecated member usage, https://github.com/flutter/flutter/issues/51951
  // ignore: deprecated_member_use
  import 'package:package_config/discovery.dart';
  // TODO(bkonyi): remove deprecated member usage, https://github.com/flutter/flutter/issues/51951
  // ignore: deprecated_member_use
  import 'package:package_config/packages.dart';
  import 'package:path/path.dart' as p; // ignore: package_path_import
  import 'package:pool/pool.dart';
  import 'package:shelf/shelf.dart' as shelf;
  
negative.code: 
    FutureOr<shelf.Response> _packageFilesHandler(shelf.Request request) async {
      if (request.requestedUri.pathSegments.first == 'packages') {
        final PackageConfig packageConfig = await _packagesFuture;
        final Uri fileUri = packageConfig.resolve(Uri(
          scheme: 'package',
          pathSegments: request.requestedUri.pathSegments.skip(1),
        ));
  