Skip to content

Commit e336324

Browse files
committed
Added sleep to hopefully reduce I/O test flakiness again
1 parent e9a9cbd commit e336324

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/outputs/advanced_file_output_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,25 @@ void main() {
120120
output.output(event0);
121121
await output.destroy();
122122

123+
// Give the OS a chance to flush to the file system (should reduce flakiness)
124+
await Future.delayed(const Duration(milliseconds: 50));
125+
123126
// Start again to roll files on init without waiting for timer tick
124127
await output.init();
125128
final event1 = OutputEvent(LogEvent(Level.fatal, ""), ["2" * 1500]);
126129
output.output(event1);
127130
await output.destroy();
128131

132+
await Future.delayed(const Duration(milliseconds: 50));
133+
129134
// And again for another roll
130135
await output.init();
131136
final event2 = OutputEvent(LogEvent(Level.fatal, ""), ["3" * 1500]);
132137
output.output(event2);
133138
await output.destroy();
134139

140+
await Future.delayed(const Duration(milliseconds: 50));
141+
135142
final files = dir.listSync();
136143

137144
// Expect only 2 files: the "latest" that is the current log file

0 commit comments

Comments
 (0)