@@ -2,6 +2,7 @@ import { containerTest, assertNonNullable } from "@internal/testcontainers";
22import { trace } from "@internal/tracing" ;
33import { expect } from "vitest" ;
44import { RunEngine } from "../index.js" ;
5+ import { createTestEngine } from "./helpers/engineFactory.js" ;
56import { setTimeout } from "node:timers/promises" ;
67import { setupAuthenticatedEnvironment , setupBackgroundWorker } from "./setup.js" ;
78
@@ -13,7 +14,7 @@ describe("RunEngine lazy waitpoint creation", () => {
1314 async ( { prisma, redisOptions } ) => {
1415 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
1516
16- const engine = new RunEngine ( {
17+ const engine = createTestEngine ( {
1718 prisma,
1819 worker : {
1920 redis : redisOptions ,
@@ -90,7 +91,7 @@ describe("RunEngine lazy waitpoint creation", () => {
9091 containerTest ( "Waitpoint created for triggerAndWait" , async ( { prisma, redisOptions } ) => {
9192 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
9293
93- const engine = new RunEngine ( {
94+ const engine = createTestEngine ( {
9495 prisma,
9596 worker : {
9697 redis : redisOptions ,
@@ -199,7 +200,7 @@ describe("RunEngine lazy waitpoint creation", () => {
199200 containerTest ( "Completion without waitpoint succeeds" , async ( { prisma, redisOptions } ) => {
200201 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
201202
202- const engine = new RunEngine ( {
203+ const engine = createTestEngine ( {
203204 prisma,
204205 worker : {
205206 redis : redisOptions ,
@@ -301,7 +302,7 @@ describe("RunEngine lazy waitpoint creation", () => {
301302 containerTest ( "Cancellation without waitpoint succeeds" , async ( { prisma, redisOptions } ) => {
302303 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
303304
304- const engine = new RunEngine ( {
305+ const engine = createTestEngine ( {
305306 prisma,
306307 worker : {
307308 redis : redisOptions ,
@@ -386,7 +387,7 @@ describe("RunEngine lazy waitpoint creation", () => {
386387 containerTest ( "TTL expiration without waitpoint succeeds" , async ( { prisma, redisOptions } ) => {
387388 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
388389
389- const engine = new RunEngine ( {
390+ const engine = createTestEngine ( {
390391 prisma,
391392 worker : {
392393 redis : redisOptions ,
@@ -485,7 +486,7 @@ describe("RunEngine lazy waitpoint creation", () => {
485486 async ( { prisma, redisOptions } ) => {
486487 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
487488
488- const engine = new RunEngine ( {
489+ const engine = createTestEngine ( {
489490 prisma,
490491 worker : {
491492 redis : redisOptions ,
@@ -606,7 +607,7 @@ describe("RunEngine lazy waitpoint creation", () => {
606607 async ( { prisma, redisOptions } ) => {
607608 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
608609
609- const engine = new RunEngine ( {
610+ const engine = createTestEngine ( {
610611 prisma,
611612 worker : {
612613 redis : redisOptions ,
@@ -701,7 +702,7 @@ describe("RunEngine lazy waitpoint creation", () => {
701702 async ( { prisma, redisOptions } ) => {
702703 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
703704
704- const engine = new RunEngine ( {
705+ const engine = createTestEngine ( {
705706 prisma,
706707 worker : {
707708 redis : redisOptions ,
@@ -818,7 +819,7 @@ describe("RunEngine lazy waitpoint creation", () => {
818819 async ( { prisma, redisOptions } ) => {
819820 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
820821
821- const engine = new RunEngine ( {
822+ const engine = createTestEngine ( {
822823 prisma,
823824 worker : {
824825 redis : redisOptions ,
@@ -930,7 +931,7 @@ describe("RunEngine lazy waitpoint creation", () => {
930931 async ( { prisma, redisOptions } ) => {
931932 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
932933
933- const engine = new RunEngine ( {
934+ const engine = createTestEngine ( {
934935 prisma,
935936 worker : {
936937 redis : redisOptions ,
@@ -1029,7 +1030,7 @@ describe("RunEngine lazy waitpoint creation", () => {
10291030 async ( { prisma, redisOptions } ) => {
10301031 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
10311032
1032- const engine = new RunEngine ( {
1033+ const engine = createTestEngine ( {
10331034 prisma,
10341035 worker : {
10351036 redis : redisOptions ,
@@ -1190,7 +1191,7 @@ describe("RunEngine lazy waitpoint creation", () => {
11901191 async ( { prisma, redisOptions } ) => {
11911192 const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
11921193
1193- const engine = new RunEngine ( {
1194+ const engine = createTestEngine ( {
11941195 prisma,
11951196 worker : {
11961197 redis : redisOptions ,
0 commit comments