Unverified Commit 0b940a44 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Flush write to disk with intent of reducing flakiness of the test. (#24144)

parent 63532eb9
...@@ -69,14 +69,14 @@ void main() { ...@@ -69,14 +69,14 @@ void main() {
expect(content.isModified, isFalse); expect(content.isModified, isFalse);
file.parent.createSync(recursive: true); file.parent.createSync(recursive: true);
file.writeAsBytesSync(<int>[1, 2, 3]); file.writeAsBytesSync(<int>[1, 2, 3], flush: true);
final DateTime fiveSecondsAgo = DateTime.now().subtract(const Duration(seconds:5)); final DateTime fiveSecondsAgo = DateTime.now().subtract(const Duration(seconds:5));
expect(content.isModifiedAfter(fiveSecondsAgo), isTrue); expect(content.isModifiedAfter(fiveSecondsAgo), isTrue);
expect(content.isModifiedAfter(fiveSecondsAgo), isTrue); expect(content.isModifiedAfter(fiveSecondsAgo), isTrue);
expect(content.isModifiedAfter(null), isTrue); expect(content.isModifiedAfter(null), isTrue);
file.writeAsBytesSync(<int>[2, 3, 4]); file.writeAsBytesSync(<int>[2, 3, 4], flush: true);
expect(content.fileDependencies, <String>[filePath]); expect(content.fileDependencies, <String>[filePath]);
expect(content.isModified, isTrue); expect(content.isModified, isTrue);
expect(content.isModified, isFalse); expect(content.isModified, isFalse);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment