Skip to content

test(rivetkit-core): cover sleep/destroy guards and prevent_sleep no-op#4750

Draft
NathanFlurry wants to merge 1 commit intosleep-cleanup/08-sleep-docsfrom
sleep-cleanup/09-rust-sleep-tests
Draft

test(rivetkit-core): cover sleep/destroy guards and prevent_sleep no-op#4750
NathanFlurry wants to merge 1 commit intosleep-cleanup/08-sleep-docsfrom
sleep-cleanup/09-rust-sleep-tests

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented Apr 24, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 24, 2026

Code Review - PR 4750 - test(rivetkit-core): cover sleep/destroy guards and prevent_sleep no-op. Overview: adds 6 tests covering sleep/destroy pre-start rejection, double-call rejection, deprecated no-op contract, and deadline token cancellation. Issues: (1) Missing cross-guard coverage - sleep() and destroy() use separate atomics so destroy-then-sleep succeeds on both; unclear if intentional. (2) CLAUDE.md says tests go under tests/ not inline in src/; pub(crate) helpers justify the exception but a comment calling it out would help. Suggestions: (1) Three tests are sync-only and don't need start_paused=true. (2) The stub wording in the no-op assertion message could be updated to match the NAPI bridge compatibility rationale in context.rs. (3) Adding assert_eq!(ctx.can_sleep().await, CanSleep::NotReady) to a before-started test would cover both guards on the started flag. Positives: structured error assertions are correct, allow(deprecated) is explicit, unique actor IDs avoid global state risk.

@github-actions
Copy link
Copy Markdown
Contributor

Preview packages published to npm

Install with:

npm install rivetkit@pr-4750

All packages published as 0.0.0-pr.4750.9b1b005 with tag pr-4750.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-9b1b005
docker pull rivetdev/engine:full-9b1b005
Individual packages
npm install rivetkit@pr-4750
npm install @rivetkit/react@pr-4750
npm install @rivetkit/rivetkit-napi@pr-4750
npm install @rivetkit/workflow-engine@pr-4750

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