Skip to content

Commit ef3c987

Browse files
committed
fmt
Signed-off-by: tison <wander4096@gmail.com>
1 parent f68545a commit ef3c987

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

appenders/file/tests/global_file_limit.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
1+
// Copyright 2024 FastLabs Developers
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
//! Ensure max_log_files limits the total number of log files across multiple date patterns.
216
3-
use logforth_append_file::FileBuilder;
4-
use logforth_core::Append;
5-
use logforth_core::record::Record;
617
use std::fs;
718
use std::num::NonZeroUsize;
819
use std::path::Path;
920
use std::thread;
1021
use std::time::Duration;
22+
23+
use logforth_append_file::FileBuilder;
24+
use logforth_core::Append;
25+
use logforth_core::record::Record;
1126
use tempfile::TempDir;
1227

1328
#[test]
@@ -77,7 +92,8 @@ fn test_file_limit_across_multiple_dates() {
7792
let max_files = 10; // Set maximum file count to 10
7893
let max_size = 50; // Small file size to trigger rotation quickly
7994

80-
// Create multiple log writers, each with a different filename pattern (simulating different dates)
95+
// Create multiple log writers, each with a different filename pattern (simulating different
96+
// dates)
8197
println!("Creating multiple log files with different date patterns");
8298

8399
// First batch - simulate March 18
@@ -114,7 +130,8 @@ fn test_file_limit_across_multiple_dates() {
114130
println!("Files: {:?}", files);
115131

116132
// Verify if the total number of files exceeds the limit
117-
// Note: If this assertion fails, it means we've reproduced the issue - file count is not properly limited
133+
// Note: If this assertion fails, it means we've reproduced the issue - file count is not
134+
// properly limited
118135
assert!(
119136
files.len() <= max_files,
120137
"Expected at most {} files, but found {} files across multiple dates",

0 commit comments

Comments
 (0)