Skip to content

Add per-command timeouts for ROS graph collection, harden integration script, and add tests#5

Merged
RN0H merged 2 commits intomasterfrom
codex/fix-failing-ros2-integration-test-8630ej
Mar 14, 2026
Merged

Add per-command timeouts for ROS graph collection, harden integration script, and add tests#5
RN0H merged 2 commits intomasterfrom
codex/fix-failing-ros2-integration-test-8630ej

Conversation

@RN0H
Copy link
Copy Markdown
Owner

@RN0H RN0H commented Mar 14, 2026

Motivation

  • Prevent a single slow or hung ros2 subcommand from stalling the whole graph collection by using per-command timeouts.
  • Make the integration test script more robust and debuggable in CI by adding retries, readiness checks, and clearer failure output.
  • Add unit tests to assert timeout/error behavior for graph collection logic.

Description

  • Introduce a graphCommandTimeout (default 10s) and a helper runGraphCommand that wraps each ros2 invocation with its own timeout and replace previous shared timeout usage in CollectSystemGraph.
  • Improve error handling in CollectSystemGraph by returning errors when ros2 topic list or ros2 service list fail.
  • Harden tests/integration.sh by using unique container names, stronger container readiness checks, retrying gim graph with JSON validation via jq, adding debug output on failure, silencing/remove-stale-container calls, and setting GIMBLE_AI_API_KEY= when running gim analyze.
  • Add two new unit tests (graph_errors_test.go and graph_timeout_test.go) to validate error propagation and per-command timeout behavior in CollectSystemGraph.
  • Update CI workflow .github/workflows/sanity.yml to install jq in the integration job so the script's JSON checks work.

Testing

  • Ran unit tests in the ROS package with go test ./internal/ros, which executed TestCollectSystemGraph_UsesPerCommandTimeout and the error tests and they passed.
  • Exercised the integration script ./tests/integration.sh (as used by the CI integration job) with jq available and the script completed successfully in CI.
  • Verified make build and the gim graph ros2/gim analyze ros2 flow in the integration script path during the integration run and observed expected JSON output.

Codex Task

@RN0H RN0H merged commit 5be5214 into master Mar 14, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant