diff options
| author | Andrew Bulhak <andrew.bulhak@mullvad.net> | 2024-04-15 10:38:46 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2024-04-17 12:40:40 +0200 |
| commit | 0cab19c236d34a4c0dbdb7eae4a2872dc93e7c42 (patch) | |
| tree | e4db2bc23f81a9da8df133f58964da99e1226f6c | |
| parent | 9af50acb7e20c7d6f50b7faf40969bb63d7e4ccf (diff) | |
| download | mullvadvpn-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.swift | 10 |
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)) } } |
