Skip to content

test(state): pin v1.0 freeze-critical surface; rename ErrActorPanic#153

Closed
joshua-temple wants to merge 1 commit into
mainfrom
test/state-v1-coverage
Closed

test(state): pin v1.0 freeze-critical surface; rename ErrActorPanic#153
joshua-temple wants to merge 1 commit into
mainfrom
test/state-v1-coverage

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Pre-v1.0-freeze hardening for crucible/state. Closes the gaps the freeze sign-off review flagged.

Tests added (previously 0% coverage on the exported contract)

  • SystemClock Now/After — the default production clock for after/delayed transitions, now driven through a real firing (fake-clock tests skipped this path).
  • WithSpawnInput round-trip; actor Output.
  • guard LeafRefs / StateInTargets; ForbidAny.
  • Nested parallel-in-parallel done-cascade — the highest-risk previously-untested semantic path. Pins innermost-first OnDone firing, each exactly once. No engine bug found; the cascade is correct.

Coverage: SystemClock/WithSpawnInput/Output/LeafRefs/ForbidAny → 100%; StateInTargets → 88.9% (uncovered arm is the g==nil guard).

Breaking (pre-v1.0)

  • Rename ErrActorPanicActorPanicError for consistency with the package's other typed errors. CHANGELOG updated.

Verification

go build/go vet clean; go test ./... -race green across all 6 packages; golangci-lint run clean.

Open question for v1.0 owner (not addressed here)

ForbidAny() currently shadows an explicit same-state On(event) handler (forbids() is checked before matchingTransitions()). The doc says it blocks events "not otherwise handled," which arguably should let a same-state handler win. The test deliberately avoids this contested precedence. Decide before freeze whether forbid-beats-same-state-handler is intended, or reconcile doc vs behavior.

Add characterization tests for previously zero-coverage exported surface
ahead of the v1.0 freeze: SystemClock Now/After driving a real `after`
transition, WithSpawnInput round-trip, actor Output, guard LeafRefs/
StateInTargets, and ForbidAny. Add a nested parallel-in-parallel done-cascade
test pinning innermost-first OnDone firing (exactly once) -- the highest-risk
previously-untested semantic path.

Rename ErrActorPanic -> ActorPanicError for consistency with the package's
other typed errors (ActionPanicError, WaitTimeoutError). Breaking change,
noted in the CHANGELOG; permissible pre-v1.0.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple

Copy link
Copy Markdown
Collaborator Author

Superseded by #162, which salvages this PR's freeze-critical coverage (parallel-in-parallel cascade test; SystemClock/LeafRefs/Output/WithSpawnInput zero-coverage funcs) onto main. The ErrActorPanic→ActorPanicError rename here is already on main via #155 (with Unwrap() and a Recovered field).

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