Skip to content

Commit e5515f7

Browse files
matt2eclaude
andcommitted
test(mobile): match the hop diagnostic's doc to its output, use it for every reply
Two optional suggestions from the final review of 93d426da1. The `waitForCallback` doc comment quoted example failures the helper cannot print: the hop is capped at 2 s, so "took 7.2 s" never occurs, and durations print as "%.1f ms". It now quotes the real forms ("did not finish within 2 s", hundreds of ms, "took 0.4 ms"), states that the hop is measured after the 10 s window so a fast hop does not rule out starvation that ended at the deadline, and presents the 2026-11-01 diagnosis as an inference, since the measurement did not exist in those runs. `testAllowedNotificationRestoreNeedsNoAppGroupStore` used a plain `wait(for:)`; it now goes through `waitForCallback`, so every bridge-reply wait in the class carries the hop report. Verification: class in isolation green once (6 tests, 0.05 s); `git diff --check` clean; the commit touches only this file, with no Podfile.lock, xcshareddata, or Dart changes. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Matt Toohey <[email protected]>
1 parent 6cc43c9 commit e5515f7

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎mobile/ios/RunnerTests/BuzzCommunicationNotificationTests.swift‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,14 @@ final class BuzzPushSnapshotEnrichmentTests: XCTestCase {
250250

251251
/// Waits for a bridge callback. On timeout the failure also reports how long
252252
/// one fresh user-initiated-queue-then-main-queue hop takes right then (the
253-
/// path every bridge reply follows), so a starved test host ("hop took 7.2 s")
254-
/// reads differently from a callback that never fired ("hop took 12 ms").
255-
/// Both 2026-11-01 CI failures were the former: the RunnerTests host is the
256-
/// full Flutter app, and its launch saturated the 3-vCPU runner mid-class.
257-
/// A passing wait returns as soon as the callback runs and measures nothing.
253+
/// path every bridge reply follows), capped at 2 s. A starved test host reads
254+
/// "a fresh queue->main hop did not finish within 2 s" or hundreds of ms; a
255+
/// callback that never fired reads "took 0.4 ms". The hop is measured after
256+
/// the 10 s window, so a fast hop does not rule out starvation that ended at
257+
/// the deadline. The 2026-11-01 CI failures predate this measurement; their
258+
/// timings fit starvation, since the RunnerTests host is the full Flutter app
259+
/// and its launch saturated the 3-vCPU runner mid-class. A passing wait
260+
/// returns as soon as the callback runs and measures nothing.
258261
private func waitForCallback(
259262
_ expectation: XCTestExpectation, file: StaticString = #filePath, line: UInt = #line
260263
) {
@@ -341,7 +344,7 @@ final class BuzzPushSnapshotEnrichmentTests: XCTestCase {
341344
received = value
342345
completed.fulfill()
343346
})
344-
wait(for: [completed], timeout: callbackTimeout)
347+
waitForCallback(completed)
345348
XCTAssertNil(received)
346349
}
347350

0 commit comments

Comments
 (0)