Repository: flutter
Issue: `analyze_continuously_test.dart` fails locally, succeeds on CI
Labels: tool,P2,c: tech-debt,team-tool,triaged-tool

```txt
/Users/matanl/Developer/flutter/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart: analyze --watch AnalysisServer success[0m
PathNotFoundException: Cannot open file, path = '/Users/matanl/Developer/flutter/version' (OS Error: No such file or directory, errno = 2)
#0      _File.throwIfError (dart:io/file_impl.dart:675:7)
#1      _File.openSync (dart:io/file_impl.dart:490:5)
#2      _File.readAsBytesSync (dart:io/file_impl.dart:574:18)
#3      _File.readAsStringSync (dart:io/file_impl.dart:624:18)
#4      ForwardingFile.readAsStringSync (package:file/src/forwarding/forwarding_file.dart:99:16)
#5      _DefaultPub._updateVersionAndPackageConfig (package:flutter_tools/src/dart/pub.dart:720:50)
#6      _DefaultPub.get (package:flutter_tools/src/dart/pub.dart:373:11)
<asynchronous suspension>
#7      main.<anonymous closure>.<anonymous closure> (file:///Users/matanl/Developer/flutter/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart:89:7)
<asynchronous suspension>
#8      testUsingContext.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///Users/matanl/Developer/flutter/packages/flutter_tools/test/src/context.dart:152:26)
<asynchronous suspension>
#9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#10     testUsingContext.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///Users/matanl/Developer/flutter/packages/flutter_tools/test/src/context.dart:141:22)
<asynchronous suspension>
```

However it passes [fine on CI in the same state](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8733080043648608785/+/u/run_test.dart_for_tool_tests_shard_and_subshard_commands/stdout):

```txt
03:07 +282 ~2: loading test/commands.shard/hermetic/analyze_continuously_test.dart
03:07 +282 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: (setUpAll)
03:07 +282 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: AnalysisServer errors
03:07 +283 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: Can run AnalysisService with customized cache location --watch
03:08 +284 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: Can run AnalysisService without suppressing analytics
03:08 +285 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: Returns no errors when source is error-free
03:08 +286 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: AnalysisService --watch skips errors from non-files
03:08 +287 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: analyze --watch AnalysisServer success
03:09 +288 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: Can run AnalysisService with customized cache location
03:09 +289 ~2: test/commands.shard/hermetic/analyze_continuously_test.dart: (tearDownAll)
```

Maybe it has something to do with `Cache.flutterRoot = getFlutterRoot();`?