Always fake ProcessManager when you fake Filesystem in tests (#42369)

...because otherwise, processes that think they're manipulating your
filesystem will be doing crazy things the test is ignoring, leading to
(at best) failures and (at worst) flakes or disk corruption.
This commit is contained in:
Ian Hickson
2019-10-11 11:23:12 -07:00
committed by GitHub
parent 292519be98
commit 08643c41d7
57 changed files with 692 additions and 171 deletions

View File

@@ -1069,7 +1069,8 @@ class ProjectFileInvalidator {
final List<Uri> invalidatedFiles = <Uri>[];
for (final Uri uri in urisToScan) {
final DateTime updatedAt = fs.statSync(
uri.toFilePath(windows: platform.isWindows)).modified;
uri.toFilePath(windows: platform.isWindows),
).modified;
if (updatedAt != null && updatedAt.isAfter(lastCompiled)) {
invalidatedFiles.add(uri);
}