Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2eb655e

Browse files
committedJul 24, 2024·
Reuse stopped containers
1 parent 792255f commit 2eb655e

File tree

1 file changed

+4
-0
lines changed
  • packages/server/src/integrations/tests/utils

1 file changed

+4
-0
lines changed
 

‎packages/server/src/integrations/tests/utils/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as mariadb from "./mariadb"
77
import { GenericContainer, StartedTestContainer } from "testcontainers"
88
import { testContainerUtils } from "@budibase/backend-core/tests"
99
import cloneDeep from "lodash/cloneDeep"
10+
import { execSync } from "child_process"
1011

1112
export type DatasourceProvider = () => Promise<Datasource>
1213

@@ -89,6 +90,9 @@ export async function startContainer(container: GenericContainer) {
8990
break
9091
} catch (e: any) {
9192
lastError = e
93+
if (e.statusCode === 409) {
94+
execSync(`docker start ${key}`)
95+
}
9296
await new Promise(resolve => setTimeout(resolve, 1000))
9397
}
9498
}

0 commit comments

Comments
 (0)
Please sign in to comment.