Skip to main content
Glama
SeeCommandTimeoutTests.swift998 B
import Foundation import PeekabooFoundation import Testing @testable import PeekabooCLI @Suite("SeeCommand wall-clock timeout") struct SeeCommandTimeoutTests { @Test("returns result before timeout") func returnsBeforeTimeout() async throws { let result = try await SeeCommand.withWallClockTimeout(seconds: 1.0) { "ok" } #expect(result == "ok") } @Test("throws detectionTimedOut when operation exceeds deadline") func timesOut() async { let error = await #expect(throws: CaptureError.self) { try await SeeCommand.withWallClockTimeout(seconds: 0.05) { try await Task.sleep(nanoseconds: 200_000_000) return "late" } } switch error { case let .detectionTimedOut(seconds): #expect(seconds == 0.05, "Timeout should propagate configured deadline") default: Issue.record("Unexpected capture error: \(error)") } } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/steipete/Peekaboo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server