mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user