Skip to content

Commit

Permalink
Added sleep to hopefully reduce I/O test flakiness again
Browse files Browse the repository at this point in the history
  • Loading branch information
Bungeefan committed May 2, 2024
1 parent e9a9cbd commit e336324
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/outputs/advanced_file_output_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,25 @@ void main() {
output.output(event0);
await output.destroy();

// Give the OS a chance to flush to the file system (should reduce flakiness)
await Future.delayed(const Duration(milliseconds: 50));

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

await Future.delayed(const Duration(milliseconds: 50));

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

await Future.delayed(const Duration(milliseconds: 50));

final files = dir.listSync();

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

0 comments on commit e336324

Please sign in to comment.