Skip to content

Commit 2be2d39

Browse files
0skiTrigger.dev RepoOps
authored andcommitted
fix(testcontainers): stop the stale-clone reaper from dropping templates mid-build
Fix a test fixture race where the shared Postgres test container could drop a template database while it was still being built. Mono-RevId: 242d60bf90ab9b07773be392a3feb66ce8f8ddaf
1 parent 882ebbb commit 2be2d39

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎internal-packages/testcontainers/src/sharedPostgres.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
const SHARED_CONTAINER_LABEL = "dev.trigger.testcontainers.shared";
1414

1515
const STALE_CLONE_MS = 2 * 60 * 60 * 1000;
16-
const CLONE_NAME = /^t([0-9a-z]+)_/;
16+
// Full clone names only: a template mid-build is not yet datistemplate and must never be reaped.
17+
const CLONE_NAME = /^t([0-9a-z]+)_.+_[0-9a-f]{8}$/;
1718

1819
const PG17_INITDB_ARGS = "--locale-provider=icu --icu-locale=en-US --encoding=UTF8";
1920

0 commit comments

Comments
 (0)