From cf6f9fdd25bdf1cdbf392db257a582fb0157d2ab Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Fri, 14 Nov 2025 14:26:26 +0000 Subject: [PATCH] Attempt to fix a flakey call service test. (#4746) --- UnitTests/Sources/ElementCallServiceTests.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UnitTests/Sources/ElementCallServiceTests.swift b/UnitTests/Sources/ElementCallServiceTests.swift index f1b189d77..569fd7d15 100644 --- a/UnitTests/Sources/ElementCallServiceTests.swift +++ b/UnitTests/Sources/ElementCallServiceTests.swift @@ -78,7 +78,7 @@ class ElementCallServiceTests: XCTestCase { XCTAssertTrue(!callProvider.reportNewIncomingCallWithUpdateCompletionCalled) } - func testLifetimeIsCapped() async { + func testLifetimeIsCapped() async throws { setupService() XCTAssertFalse(callProvider.reportNewIncomingCallWithUpdateCompletionCalled) @@ -89,8 +89,9 @@ class ElementCallServiceTests: XCTestCase { didReceiveIncomingPushWith: pushPayload, for: .voIP) { } - // advance pass the max timeout but below the 300 + // Advance past the max timeout but below the 300 await testClock.advance(by: .seconds(100)) + try await Task.sleep(for: .milliseconds(100)) // Make sure there's time for the unanswered call to be reported. // Call should have ended with unanswered XCTAssertTrue(callProvider.reportCallWithEndedAtReasonCalled)