11import { ClickHouse } from "@internal/clickhouse" ;
2- import { containerTest } from "@internal/testcontainers" ;
2+ import { replicationContainerTest } from "@internal/testcontainers" ;
33import { setTimeout } from "node:timers/promises" ;
44import { z } from "zod" ;
55import { TaskRunStatus } from "~/database-types" ;
@@ -11,7 +11,7 @@ import superjson from "superjson";
1111vi . setConfig ( { testTimeout : 60_000 } ) ;
1212
1313describe ( "RunsReplicationService (part 1/2)" , ( ) => {
14- containerTest (
14+ replicationContainerTest (
1515 "should replicate runs to clickhouse" ,
1616 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
1717 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -135,7 +135,7 @@ describe("RunsReplicationService (part 1/2)", () => {
135135 }
136136 ) ;
137137
138- containerTest (
138+ replicationContainerTest (
139139 "should replicate runs with super json payloads to clickhouse" ,
140140 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
141141 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -276,7 +276,7 @@ describe("RunsReplicationService (part 1/2)", () => {
276276 }
277277 ) ;
278278
279- containerTest (
279+ replicationContainerTest (
280280 "should not produce any flush spans when no TaskRun events are produced" ,
281281 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
282282 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -348,7 +348,7 @@ describe("RunsReplicationService (part 1/2)", () => {
348348 }
349349 ) ;
350350
351- containerTest (
351+ replicationContainerTest (
352352 "should replicate a new TaskRun to ClickHouse using batching insert strategy" ,
353353 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
354354 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -452,7 +452,7 @@ describe("RunsReplicationService (part 1/2)", () => {
452452 }
453453 ) ;
454454
455- containerTest (
455+ replicationContainerTest (
456456 "should insert the payload into ClickHouse when a TaskRun is created" ,
457457 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
458458 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -553,7 +553,7 @@ describe("RunsReplicationService (part 1/2)", () => {
553553 }
554554 ) ;
555555
556- containerTest (
556+ replicationContainerTest (
557557 "should insert the payload even if it's very large into ClickHouse when a TaskRun is created" ,
558558 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
559559 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -659,7 +659,7 @@ describe("RunsReplicationService (part 1/2)", () => {
659659 }
660660 ) ;
661661
662- containerTest (
662+ replicationContainerTest (
663663 "should replicate updates to an existing TaskRun to ClickHouse" ,
664664 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
665665 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -766,7 +766,7 @@ describe("RunsReplicationService (part 1/2)", () => {
766766 }
767767 ) ;
768768
769- containerTest (
769+ replicationContainerTest (
770770 "should replicate deletions of a TaskRun to ClickHouse and mark as deleted" ,
771771 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
772772 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -866,7 +866,7 @@ describe("RunsReplicationService (part 1/2)", () => {
866866 }
867867 ) ;
868868
869- containerTest (
869+ replicationContainerTest (
870870 "should gracefully shutdown and allow a new service to pick up from the correct LSN (handover)" ,
871871 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
872872 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -1017,7 +1017,7 @@ describe("RunsReplicationService (part 1/2)", () => {
10171017 }
10181018 ) ;
10191019
1020- containerTest (
1020+ replicationContainerTest (
10211021 "should not re-process already handled data if shutdown is called after all transactions are processed" ,
10221022 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
10231023 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
@@ -1160,7 +1160,7 @@ describe("RunsReplicationService (part 1/2)", () => {
11601160 }
11611161 ) ;
11621162
1163- containerTest (
1163+ replicationContainerTest (
11641164 "should record metrics with correct values when replicating runs" ,
11651165 async ( { clickhouseContainer, redisOptions, postgresContainer, prisma } ) => {
11661166 await prisma . $executeRawUnsafe ( `ALTER TABLE public."TaskRun" REPLICA IDENTITY FULL;` ) ;
0 commit comments