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
@@ -181,11 +181,15 @@ struct TimelineMediaPreviewViewModelTests {
// When confirming the redaction.
let deferred = deferFulfillment(viewModel.actions) { $0 == .dismiss }
context.send(viewAction: .redactConfirmation(item: mediaItem))
// The redaction runs in an unstructured task, so wait for the call rather than asserting after the dismiss.
await waitForConfirmation { confirmation in
timelineController.redactClosure = { _ in confirmation() }
context.send(viewAction: .redactConfirmation(item: mediaItem))
}
// Then the item should be redacted and the view should be dismissed.
try await deferred.fulfill()
#expect(timelineController.redactCalled)
}
@Test