Fix for flaky tests (#5869)

* possible logging tests fix

* fix for flaky tests

* use timelimit for max test time

* pr suggestions

* remove comment
This commit is contained in:
Mauro
2026-07-14 18:01:36 +02:00
committed by GitHub
parent 85f28d017d
commit 39bd882a27
14 changed files with 231 additions and 132 deletions
+5
View File
@@ -331,6 +331,11 @@ final class LoggingTests {
/// to start with a fresh state (as calling ``Tracing.deleteLogFiles`` would trigger the bug).
private func setupTest(name: String = #function, redirectTracingFileWriter: Bool = true) throws {
let testDirectory = URL.appGroupLogsDirectory.appending(component: name, directoryHint: .isDirectory)
// CI retries re-run the suite on the same simulator, so clear out any log files left
// behind by a previous attempt. No writer points at the directory yet, so this is safe.
try? FileManager.default.removeItem(at: testDirectory)
Tracing.logsDirectoryOverride = testDirectory
try? FileManager.default.createDirectory(at: testDirectory, withIntermediateDirectories: true)