Skip to content

Stabilize mockgrbl e2e timing assertions#77

Merged
ianbruene merged 1 commit into
masterfrom
codex/fix-mockgrbl-integration-test-timing-issues
Jul 17, 2026
Merged

Stabilize mockgrbl e2e timing assertions#77
ianbruene merged 1 commit into
masterfrom
codex/fix-mockgrbl-integration-test-timing-issues

Conversation

@ianbruene

Copy link
Copy Markdown
Owner

Motivation

  • The existing Linux-only mockgrbl integration tests raced on asynchronous serial processing when reading /responses or accepting non-specific controller states, causing intermittent failures.
  • The goal is to make the tests wait for observable mock output and require exact final controller state without changing production behavior or CI tags.

Description

  • Add a bounded polling helper waitForMockResponses(t *testing.T, m *mockProcess, timeout time.Duration, pred func([]mockLogEntry) bool) []mockLogEntry that polls GET /responses and fails with useful diagnostics if the predicate is not met.
  • Update the jog-limit rejection test in internal/integration/mockgrbl/mockgrbl_e2e_test.go to call waitForMockResponses(...) and wait for both [MSG:jogLIM] and error:15 before asserting the final safe mock state.
  • Tighten the jog-completion test to require the controller-observed MachineState to be exactly Idle instead of accepting any non-Jog state, while keeping the existing final status request.
  • Changes are limited to internal/integration/mockgrbl/mockgrbl_e2e_test.go and preserve all build tags and production behavior.

Testing

  • Ran go test -tags 'serial mockgrbl_e2e' ./internal/integration/mockgrbl and it passed (ok github.com/ianbruene/ddgo/internal/integration/mockgrbl).
  • Ran full unit suite with go test ./... and it passed for all packages.
  • Ran targeted serial tests with go test -tags serial ./internal/transport ./internal/ports ./internal/app ./internal/grbl and they passed.
  • Changed files: internal/integration/mockgrbl/mockgrbl_e2e_test.go.
  • Commands executed: gofmt -w internal/integration/mockgrbl/mockgrbl_e2e_test.go, go test -tags 'serial mockgrbl_e2e' ./internal/integration/mockgrbl, go test ./..., and go test -tags serial ./internal/transport ./internal/ports ./internal/app ./internal/grbl.

Codex Task

@ianbruene
ianbruene merged commit ebcb915 into master Jul 17, 2026
3 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