diff options
| author | David Lönnhager <david.l@mullvad.net> | 2025-05-14 13:38:56 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2025-05-14 13:38:56 +0200 |
| commit | 87ea9fdb1d7a76b0f5b234def156bb9a31ee3b83 (patch) | |
| tree | a2b76546cdb3244c0a938cc46e14decedb7c43e6 | |
| parent | f6e1bd9f9f0bb44cbec5938efaed8f9f00f25650 (diff) | |
| parent | b867066f83b521c1c169412e9d1e3b964dd4c599 (diff) | |
| download | mullvadvpn-87ea9fdb1d7a76b0f5b234def156bb9a31ee3b83.tar.xz mullvadvpn-87ea9fdb1d7a76b0f5b234def156bb9a31ee3b83.zip | |
Merge branch 'fix-log-truncation-tests'
| -rw-r--r-- | test/test-runner/src/logging.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test-runner/src/logging.rs b/test/test-runner/src/logging.rs index 706ff2eed3..6ca19c2c63 100644 --- a/test/test-runner/src/logging.rs +++ b/test/test-runner/src/logging.rs @@ -20,7 +20,7 @@ const INCLUDE_LOG_FILE_EXT: &str = "log"; /// Ignore log files that contain ".old" const EXCLUDE_LOG_FILE_CONTAIN: &str = ".old"; /// Maximum number of lines that each log file may contain -const TRUNCATE_LOG_FILE_LINES: usize = 100; +const TRUNCATE_LOG_FILE_LINES: usize = 200; pub static LOGGER: LazyLock<StdOutBuffer> = LazyLock::new(|| { let (sender, listener) = channel(MAX_OUTPUT_BUFFER); @@ -135,7 +135,9 @@ async fn read_truncated<T: AsRef<Path>>( output.push(line); } if let Some(max_number_of_lines) = truncate_lines { - output.truncate(max_number_of_lines); + if output.len() > max_number_of_lines { + output = output.split_off(output.len() - max_number_of_lines); + } } Ok(output.join("\n")) } |
