Skip to content

Commit e23d8f8

Browse files
committed
test(rivetkit): enable driver lifecycle regressions
1 parent 0e11909 commit e23d8f8

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

rivetkit-typescript/packages/rivetkit/tests/driver/actor-lifecycle.test.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,7 @@ describeDriverMatrix("Actor Lifecycle", (driverTestConfig) => {
323323
expect(elapsedMs).toBeLessThan(1_500);
324324
}, 10_000);
325325

326-
// TODO(#4706): Root-cause destroy-during-start lifecycle ordering and re-enable this coverage.
327-
test.skip("onDestroy is called even when actor is destroyed during start", async (c) => {
326+
test("onDestroy is called even when actor is destroyed during start", async (c) => {
328327
const { client } = await setupDriverTest(c, driverTestConfig);
329328

330329
const actorKey = `test-ondestroy-during-start-${Date.now()}`;
@@ -336,9 +335,19 @@ describeDriverMatrix("Actor Lifecycle", (driverTestConfig) => {
336335
const statePromise = actor.getState();
337336
await actor.destroy();
338337

339-
// Verify onDestroy was called (requires actor to be started)
340338
const state = await statePromise;
341-
expect(state.destroyCalled).toBe(true);
339+
expect(state.startCompleted).toBe(true);
340+
341+
const observer = client.lifecycleObserver.getOrCreate([
342+
"observer",
343+
]);
344+
const events = await observer.getEvents();
345+
expect(events).toContainEqual(
346+
expect.objectContaining({
347+
actorKey,
348+
event: "destroy",
349+
}),
350+
);
342351
});
343352
});
344353
});

rivetkit-typescript/packages/rivetkit/tests/driver/actor-sleep.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ describeDriverMatrix("Actor Sleep", (driverTestConfig) => {
157157
);
158158
});
159159

160-
// TODO(#4707): Root-cause persistent connection sleep-state behavior and re-enable this coverage.
161-
test.skip("actor sleep persists state with connect", async (c) => {
160+
test("actor sleep persists state with connect", async (c) => {
162161
const { client } = await setupDriverTest(c, driverTestConfig);
163162

164163
// Create actor with persistent connection

rivetkit-typescript/packages/rivetkit/tests/driver/actor-workflow.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,7 @@ describeDriverMatrix("Actor Workflow", (driverTestConfig) => {
443443
});
444444
});
445445

446-
// TODO(#4708): Root-cause failed-step sleep-vs-run-error behavior and re-enable this coverage.
447-
test.skip("failed workflow steps sleep instead of surfacing as run errors", async (c) => {
446+
test("failed workflow steps sleep instead of surfacing as run errors", async (c) => {
448447
const { client } = await setupDriverTest(c, driverTestConfig);
449448
const actor = client.workflowFailedStepActor.getOrCreate([
450449
"workflow-failed-step",

0 commit comments

Comments
 (0)