Skip to content

Commit cd0e39d

Browse files
committed
Added sleep to "fix" I/O test flakiness
1 parent e336324 commit cd0e39d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/outputs/advanced_file_output_test.dart

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

123+
// TODO Find out why test is so flaky with durations <1000ms
123124
// Give the OS a chance to flush to the file system (should reduce flakiness)
124-
await Future.delayed(const Duration(milliseconds: 50));
125+
await Future.delayed(const Duration(milliseconds: 1000));
125126

126127
// Start again to roll files on init without waiting for timer tick
127128
await output.init();
128129
final event1 = OutputEvent(LogEvent(Level.fatal, ""), ["2" * 1500]);
129130
output.output(event1);
130131
await output.destroy();
131132

132-
await Future.delayed(const Duration(milliseconds: 50));
133+
await Future.delayed(const Duration(milliseconds: 1000));
133134

134135
// And again for another roll
135136
await output.init();
136137
final event2 = OutputEvent(LogEvent(Level.fatal, ""), ["3" * 1500]);
137138
output.output(event2);
138139
await output.destroy();
139140

140-
await Future.delayed(const Duration(milliseconds: 50));
141+
await Future.delayed(const Duration(milliseconds: 1000));
141142

142143
final files = dir.listSync();
143144

0 commit comments

Comments
 (0)