UI fixes
Some checks failed
CI / Test And Build (push) Has been cancelled

This commit is contained in:
Akshay Kolli
2026-07-08 01:13:02 -04:00
parent c7316105c7
commit d86d392c3a
46 changed files with 17543 additions and 1561 deletions

View File

@@ -12,8 +12,8 @@ final class DiagnosticsServiceTests: XCTestCase {
diagnostics.incrementDatabaseMutation()
diagnostics.incrementCachePurge()
// The counters use a serial async queue for low overhead; sync through reset's queue by reading a snapshot.
let snapshot = waitForSnapshot { diagnostics.currentSnapshot() }
// The snapshot read synchronizes with the serial diagnostics queue.
let snapshot = diagnostics.currentSnapshot()
XCTAssertEqual(snapshot.monitorTicks, 1)
XCTAssertEqual(snapshot.pasteboardChanges, 1)
XCTAssertEqual(snapshot.extractionAttempts, 1)
@@ -23,13 +23,4 @@ final class DiagnosticsServiceTests: XCTestCase {
diagnostics.reset()
XCTAssertEqual(diagnostics.currentSnapshot(), .init(monitorTicks: 0, pasteboardChanges: 0, extractionAttempts: 0, databaseMutations: 0, cachePurges: 0))
}
private func waitForSnapshot(_ snapshot: @escaping () -> DiagnosticsService.Snapshot) -> DiagnosticsService.Snapshot {
let expectation = expectation(description: "diagnostics queue")
DispatchQueue.global().asyncAfter(deadline: .now() + 0.05) {
expectation.fulfill()
}
wait(for: [expectation], timeout: 1)
return snapshot()
}
}