summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Bulhak <andrew.bulhak@mullvad.net>2024-04-15 10:38:46 +0200
committerBug Magnet <marco.nikic@mullvad.net>2024-04-17 12:40:40 +0200
commit0cab19c236d34a4c0dbdb7eae4a2872dc93e7c42 (patch)
treee4db2bc23f81a9da8df133f58964da99e1226f6c
parent9af50acb7e20c7d6f50b7faf40969bb63d7e4ccf (diff)
downloadmullvadvpn-0cab19c236d34a4c0dbdb7eae4a2872dc93e7c42.tar.xz
mullvadvpn-0cab19c236d34a4c0dbdb7eae4a2872dc93e7c42.zip
Wait for the logfile to settle before attempting to read it in tests
-rw-r--r--ios/MullvadVPNTests/LoggingTests.swift10
1 files changed, 6 insertions, 4 deletions
diff --git a/ios/MullvadVPNTests/LoggingTests.swift b/ios/MullvadVPNTests/LoggingTests.swift
index af0a9e857a..ecb782571a 100644
--- a/ios/MullvadVPNTests/LoggingTests.swift
+++ b/ios/MullvadVPNTests/LoggingTests.swift
@@ -37,9 +37,11 @@ class MullvadLoggingTests: XCTestCase {
Logger(label: "test").info(":-P")
- // For some reason, reading the file fails here, despite the file existing. Manual inspection reveals the file to have the correct header. ¯\_(ツ)_/¯
-// let contents = String(decoding: try! Data(contentsOf: fileURL), as: UTF8.self)
-//
-// XCTAssert(contents.hasPrefix(expectedHeader))
+ // Wait for the log file to settle
+ usleep(100000)
+
+ let contents = String(decoding: try! Data(contentsOf: fileURL), as: UTF8.self)
+
+ XCTAssert(contents.hasPrefix(expectedHeader))
}
}