mirror of
https://github.com/stablyai/orca.git
synced 2026-09-25 16:02:38 +00:00
test(mobile): order each effect against the sends with a send count
Sender and effects are two independent lists, so a send reordered ahead of a device write moved neither. Scheduling the codex journal write on a timer instead of awaiting it left all 520 goldens byte-identical; with `sent` it moves two. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
This commit is contained in:
@@ -22,11 +22,14 @@ export async function runRecording(
|
||||
): Promise<Recording> {
|
||||
scheduler.start()
|
||||
const transport = new ScriptedRpcTransport(scheduler.elapsed)
|
||||
const effects: { name: string; value: RecordedValue }[] = []
|
||||
const effects: { name: string; value: RecordedValue; sent: number }[] = []
|
||||
const settlements: Record<string, Settlement> = {}
|
||||
const recording: Recording = { scenario: scenario.id, checkpoints: [] }
|
||||
const effect = (name: string, value: unknown) => {
|
||||
effects.push({ name, value: captureValue(value) })
|
||||
// Why the send count: sender and effects are two independent lists, so a send reordered ahead of
|
||||
// a device write moves neither of them. Stamping the count at push time orders them against
|
||||
// each other, and that reordering becomes a golden diff.
|
||||
effects.push({ name, value: captureValue(value), sent: transport.requests.length })
|
||||
}
|
||||
const stopUnhandled = recordUnhandledRejections(effect)
|
||||
let mounted: MountedOperation | undefined
|
||||
|
||||
Reference in New Issue
Block a user