From 731cdb62426b0bad5ecee86ea758ad9e78d47c68 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 4 May 2026 01:03:38 -0700 Subject: [PATCH] test(rivetkit): enable driver lifecycle regressions --- .../tests/driver/actor-lifecycle.test.ts | 17 +++++++++++++---- .../rivetkit/tests/driver/actor-sleep.test.ts | 3 +-- .../tests/driver/actor-workflow.test.ts | 3 +-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/rivetkit-typescript/packages/rivetkit/tests/driver/actor-lifecycle.test.ts b/rivetkit-typescript/packages/rivetkit/tests/driver/actor-lifecycle.test.ts index a4973ef543..e380e0cd02 100644 --- a/rivetkit-typescript/packages/rivetkit/tests/driver/actor-lifecycle.test.ts +++ b/rivetkit-typescript/packages/rivetkit/tests/driver/actor-lifecycle.test.ts @@ -323,8 +323,7 @@ describeDriverMatrix("Actor Lifecycle", (driverTestConfig) => { expect(elapsedMs).toBeLessThan(1_500); }, 10_000); - // TODO(#4706): Root-cause destroy-during-start lifecycle ordering and re-enable this coverage. - test.skip("onDestroy is called even when actor is destroyed during start", async (c) => { + test("onDestroy is called even when actor is destroyed during start", async (c) => { const { client } = await setupDriverTest(c, driverTestConfig); const actorKey = `test-ondestroy-during-start-${Date.now()}`; @@ -336,9 +335,19 @@ describeDriverMatrix("Actor Lifecycle", (driverTestConfig) => { const statePromise = actor.getState(); await actor.destroy(); - // Verify onDestroy was called (requires actor to be started) const state = await statePromise; - expect(state.destroyCalled).toBe(true); + expect(state.startCompleted).toBe(true); + + const observer = client.lifecycleObserver.getOrCreate([ + "observer", + ]); + const events = await observer.getEvents(); + expect(events).toContainEqual( + expect.objectContaining({ + actorKey, + event: "destroy", + }), + ); }); }); }); diff --git a/rivetkit-typescript/packages/rivetkit/tests/driver/actor-sleep.test.ts b/rivetkit-typescript/packages/rivetkit/tests/driver/actor-sleep.test.ts index 946d363227..6c7d3254fe 100644 --- a/rivetkit-typescript/packages/rivetkit/tests/driver/actor-sleep.test.ts +++ b/rivetkit-typescript/packages/rivetkit/tests/driver/actor-sleep.test.ts @@ -157,8 +157,7 @@ describeDriverMatrix("Actor Sleep", (driverTestConfig) => { ); }); - // TODO(#4707): Root-cause persistent connection sleep-state behavior and re-enable this coverage. - test.skip("actor sleep persists state with connect", async (c) => { + test("actor sleep persists state with connect", async (c) => { const { client } = await setupDriverTest(c, driverTestConfig); // Create actor with persistent connection diff --git a/rivetkit-typescript/packages/rivetkit/tests/driver/actor-workflow.test.ts b/rivetkit-typescript/packages/rivetkit/tests/driver/actor-workflow.test.ts index 2a74e52923..d32b244484 100644 --- a/rivetkit-typescript/packages/rivetkit/tests/driver/actor-workflow.test.ts +++ b/rivetkit-typescript/packages/rivetkit/tests/driver/actor-workflow.test.ts @@ -443,8 +443,7 @@ describeDriverMatrix("Actor Workflow", (driverTestConfig) => { }); }); - // TODO(#4708): Root-cause failed-step sleep-vs-run-error behavior and re-enable this coverage. - test.skip("failed workflow steps sleep instead of surfacing as run errors", async (c) => { + test("failed workflow steps sleep instead of surfacing as run errors", async (c) => { const { client } = await setupDriverTest(c, driverTestConfig); const actor = client.workflowFailedStepActor.getOrCreate([ "workflow-failed-step",