Fix hot-restart test by ensuring updated timestmamp is in the future. (#97247)

On Windows modified timestamps are round down to a second, which can lead to missed file updates.

Fixes https://github.com/flutter/flutter/issues/96677
This commit is contained in:
Alexander Aprelev 2022-01-25 14:18:33 -08:00 committed by GitHub
parent 3901aca352
commit 752de49450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -55,7 +55,7 @@ void main() {
await Future<void>.delayed(const Duration(milliseconds: 10));
await subscription.cancel();
await flutter.stop();
}, skip: true); // Flake: https://github.com/flutter/flutter/issues/96677
});
testWithoutContext('Hot reload updates background isolates', () async {
final RepeatingBackgroundProject project = RepeatingBackgroundProject();

View File

@ -51,7 +51,8 @@ class BackgroundProject extends Project {
void updateTestIsolatePhrase(String message) {
final String newMainContents = main.replaceFirst('Isolate thread', message);
writeFile(fileSystem.path.join(dir.path, 'lib', 'main.dart'), newMainContents);
writeFile(fileSystem.path.join(dir.path, 'lib', 'main.dart'), newMainContents,
writeFutureModifiedDate: true);
}
}