From 752de49450201ff4c8eaa25ee4632e22520590ab Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 25 Jan 2022 14:18:33 -0800 Subject: [PATCH] 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 --- .../test/integration.shard/background_isolate_test.dart | 2 +- .../test/integration.shard/test_data/background_project.dart | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/test/integration.shard/background_isolate_test.dart b/packages/flutter_tools/test/integration.shard/background_isolate_test.dart index e2bcf1a9cef..eef89db5fc3 100644 --- a/packages/flutter_tools/test/integration.shard/background_isolate_test.dart +++ b/packages/flutter_tools/test/integration.shard/background_isolate_test.dart @@ -55,7 +55,7 @@ void main() { await Future.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(); diff --git a/packages/flutter_tools/test/integration.shard/test_data/background_project.dart b/packages/flutter_tools/test/integration.shard/test_data/background_project.dart index 13e37f1ea09..270f3a45416 100644 --- a/packages/flutter_tools/test/integration.shard/test_data/background_project.dart +++ b/packages/flutter_tools/test/integration.shard/test_data/background_project.dart @@ -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); } }