test(engine): force overdue branch in alarm-during-sleep test with negative offset#4758
Conversation
Code Review: PR #4758SummaryThis PR makes the CorrectnessThe core idea is sound. The alarm timestamp is computed as: let alarm_time = get_current_timestamp_ms() + self.alarm_offset_ms;With Potential Issue: Subscription Ordering RaceThe The comment says "Subscribe before the actor enters sleep," but the subscription happens after the ready signal, which comes from inside A safer sequence would be:
Whether this is a real concern depends on the channel buffer size of Recommendation: Move Code Quality
Minor NitThere is no assertion that the actor did not enter sleep state. The test only asserts the positive path (generation-1 wake via reallocation). This is acceptable given the timeout semantics, but a brief comment explaining this choice would be helpful. Summary
The core change is correct and a clear improvement over the previous timing-dependent approach. |
1939547 to
68ddecb
Compare
3f88401 to
0e7355d
Compare
Preview packages published to npmInstall with: npm install rivetkit@pr-4758All packages published as Engine binary is shipped via Docker images: docker pull rivetdev/engine:slim-f601302
docker pull rivetdev/engine:full-f601302Individual packagesnpm install rivetkit@pr-4758
npm install @rivetkit/react@pr-4758
npm install @rivetkit/rivetkit-napi@pr-4758
npm install @rivetkit/workflow-engine@pr-4758 |
68ddecb to
a4740bd
Compare
0e7355d to
14910da
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: