Skip to content

Harden runner and test timing coverage#107

Merged
ryansimmen merged 9 commits intomainfrom
ryansimmen/mato
Apr 25, 2026
Merged

Harden runner and test timing coverage#107
ryansimmen merged 9 commits intomainfrom
ryansimmen/mato

Conversation

@ryansimmen
Copy link
Copy Markdown
Owner

Summary

  • Preserve interactive agent terminal output while expanding runner recovery coverage.
  • Remove timing-dependent sleeps from messaging, status watch, and session tests.
  • Add queueview diagnostics coverage and centralize shared test fixtures.

Testing

  • Not run in this PR creation step; commits include targeted test updates.

Adds missing conventional GoDoc comments for exported frontmatter metadata and queue compatibility symbols. The queue compatibility comments clarify that aliases and wrappers forward to queueview behavior.

Task-ID: add-missing-godoc-comments
Affects: internal/frontmatter/frontmatter.go, internal/queue/compat.go
Add direct queueview tests for empty diagnostics, cycles, mixed issue reporting, and completed dependency aliases. This keeps dependency analysis regression coverage close to DiagnoseDependencies without relying on the compat layer.

Task-ID: add-queueview-diagnostics-tests
Affects: internal/queueview/diagnostics_test.go
Adds a local time seam for session metadata timestamps so unchanged-session behavior can be tested deterministically. The test now compares persisted content and updated_at values instead of waiting on filesystem mtime granularity.

Task-ID: remove-session-test-sleep
Affects: internal/runtimedata/session.go, internal/runtimedata/session_test.go
Extract the status watch redraw loop behind a tick-channel helper so tests can trigger refreshes deterministically while public watch APIs continue using a real ticker.
Active file claims showed the status watch files reserved for this same task, and the change stays within that claimed scope.

Task-ID: remove-status-watch-test-sleeps
Affects: internal/status/status.go, internal/status/status_test.go
Replaces scheduler-dependent sleeps in messaging concurrency tests with explicit start barriers, bounded polling, and deletion/write handoffs. This keeps the race coverage deterministic without changing production messaging code.

Task-ID: remove-messaging-test-sleeps
Affects: internal/messaging/messaging_test.go
Runner shutdown recovery now threads cancellation into stuck-task recovery so cancelled agents return tasks to backlog without generic failure markers. Added targeted coverage for pause state handling, bounded-run state detection, bounded-run errors, and cancelled recovery.

Task-ID: harden-runner-shutdown-and-bounded-run
Affects: internal/runner/runner_poll.go, internal/runner/task.go, internal/runner/runner_test.go, internal/runner/task_test.go
Centralizes duplicated non-buffering writer and verdict JSON test fixtures in internal/testutil. Converts taskfile branch parser tests to an external package to avoid a test-only import cycle from the shared verdict helper.

Task-ID: add-shared-test-fixture-helpers
Affects: internal/testutil/testutil.go, cmd/mato/main_test.go, internal/doctor/render_test.go, internal/graph/graph_test.go, internal/graph/render_test.go, internal/history/history_test.go, internal/inspect/inspect_test.go, internal/queueview/index_test.go
@ryansimmen ryansimmen merged commit 176979f into main Apr 25, 2026
5 checks passed
@ryansimmen ryansimmen deleted the ryansimmen/mato branch April 25, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant