Releases: restatedev/e2e
v2.1
v2.0
SDK Test Suite v2.0 Contract Changes
This document describes every contract change between v1.0 and v2.0. SDK implementations must update their test services to conform to this version.
VirtualObjectCommandInterpreter
New AwaitableCommand types
Two new sub-commands that can be used inside any combinator (AwaitOne, AwaitAny, AwaitFirstCompleted, AwaitAllCompleted, etc.).
createSignal
{ "type": "createSignal", "signalName": "<string>" }Awaits a named signal on the current invocation. Signals are identified by the invocation ID + name and resolve to a string. The signal future resolves when an external caller resolves it via TestUtilsService.resolveSignal, or rejects when TestUtilsService.rejectSignal is called.
Unlike awakeables, signals do not need to be pre-registered before being resolved ? the resolution can arrive before or after the handler starts waiting.
Return value: the resolved string value.
runReturns
{ "type": "runReturns", "value": "<string>" }Executes a ctx.run side effect that returns the given value. The run must be genuinely async (i.e. the implementation must suspend inside the run block, not return synchronously). Return value: value.
New Command types (combinators)
Four new top-level combinator commands. All accept commands: AwaitableCommand[] and return a string.
awaitFirstSucceededOrAllFailed
{ "type": "awaitFirstSucceededOrAllFailed", "commands": [...] }Semantics: Promise.any / RestatePromise.any. Resolves with the value of the first successful command. If all commands fail with terminal errors, throws with the last error.
Return value: the string value of the first command to succeed.
awaitFirstCompleted
{ "type": "awaitFirstCompleted", "commands": [...] }Semantics: Promise.race / RestatePromise.race. Resolves or rejects with whatever the first command to complete does, regardless of success or failure.
Return value: the string value of the first command to settle. Sleep returns "sleep".
awaitAllSucceededOrFirstFailed
{ "type": "awaitAllSucceededOrFirstFailed", "commands": [...] }Semantics: Promise.all / RestatePromise.all. Waits for all commands to succeed. Throws immediately on the first failure.
Return value: all resolved values pipe-joined in input order: "val0|val1|val2". Sleep contributes "sleep".
awaitAllCompleted
{ "type": "awaitAllCompleted", "commands": [...] }Semantics: Promise.allSettled / RestatePromise.allSettled. Waits for all commands to settle, whether they succeed or fail. Never throws.
Return value: pipe-joined settled results in input order: "ok:val0|err:reason1|ok:val2". Sleep contributes "ok:sleep".
TestUtilsService
Removed
sleepConcurrently
sleepConcurrently(millisDuration: List<Long>)
Removed. The Sleep and SleepWithFailures tests now drive sleeps through VirtualObjectCommandInterpreter (AwaitOne(Sleep(...)) and AwaitAllCompleted([Sleep(...), ...])). Implementations no longer need this handler.
Added
resolveSignal
{ "invocationId": "<string>", "signalName": "<string>", "value": "<string>" }Resolves a named signal on the target invocation with a string value. The implementation should call the signal resolution API.
rejectSignal
{ "invocationId": "<string>", "signalName": "<string>", "reason": "<string>" }Rejects a named signal on the target invocation. The handler awaiting the signal will receive a terminal error with reason as the message.
v1.0
Fix persisted timers test suite