fix(verification): bound the KiCad UI health check - #283
Closed
nordic-style wants to merge 2 commits into
Closed
Conversation
Validate timeout_seconds and apply one Tokio deadline to process detection plus IPC ping, reporting timeout state and elapsed time explicitly. Refs mixelpixx#251
Treat pcbnew and eeschema as GUI processes on every platform, and let a responsive IPC endpoint prove that KiCad is running even when process inspection misses its launcher. Report process detection separately for diagnostics.\n\nRefs mixelpixx#251
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User-visible problem and scope
check_kicad_ui.timeout_secondswas advertised but ignored. A caller could request a short health-check deadline and still wait on the fixed process/IPC behavior, while the response implied the timeout was meaningful.This PR applies one bounded deadline across the complete KiCad process check and IPC ping. It also recognizes standalone
pcbnew/eeschemaprocesses and treats responsive IPC as authoritative running evidence.Refs #251
Root cause and design
The handler never read the schema field and performed its phases independently. It also checked only the top-level
kicadprocess and skipped IPC entirely when that process was absent, so a standalone macOSpcbnewreturnedrunning: falsewhileopen_projectwas successfully using its socket.The handler now validates an integer range of 1–300 seconds, wraps the complete health future in one Tokio timeout, checks
kicad,pcbnew, andeeschema, and always probes IPC. A responsive endpoint is sufficient running evidence;process_detectedremains separate diagnostic evidence. Timeout failures are typed and do not wait for the abandoned inner future.Compatibility and migration
The existing default remains 5 seconds. Valid callers now get the documented bound; invalid types/ranges get a structured
invalid_argument. The check remains read-only.Validation
cargo test -p konnect-core health_ --lockedcargo test -p konnect-core standalone_editors_count_as_kicad_ui_processes --lockedcargo test -p konnect-core responsive_ipc_is_sufficient_running_evidence --lockedcargo clippy --workspace --locked --all-targets -- -D warningscargo fmt --all -- --checkkonnect-coretests pass, with only the same three installed-Device:Rfixture-shadowing failures reproduced on unmodifiedmain.pcbnew:running: true,process_detected: true, andipc_responsive: truein 39 ms.Risk and rollback
Risk is limited to health-check timing and cancellation. No project state is touched. Tests use a deliberately pending future to prove the outer deadline returns promptly. Rollback is one commit.