Skip to content

Commit 833f4d8

Browse files
fix(test): bump Docker test timeout to 60s
The 3 'DynamoDB Local (Docker)' tests pass locally but time out at 5001ms in CI because GitHub-hosted runners have to pull the `amazon/dynamodb-local` image on first use (often 30-60s) before the container can even start. Bun's default 5s timeout is nowhere near enough. The `dockerAvailable` early-return guards are kept — they catch environments where docker isn't installed at all. The new timeout covers the case where docker IS available but image pull + container start exceeds 5s.
1 parent 68603cb commit 833f4d8

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

test/toolkit.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ describe('dynamodb-tooling', () => {
6666
}
6767
})
6868

69+
// Docker tests get a generous timeout: GitHub-hosted runners need to
70+
// pull `amazon/dynamodb-local` on first use (often 30-60s) and then
71+
// start the container before the test body even reaches its assertions.
72+
// Bun's default 5s timeout is nowhere near enough.
73+
const DOCKER_TIMEOUT_MS = 60_000
74+
6975
it('should launch DynamoDB Local via Docker', async () => {
7076
if (!dockerAvailable) {
7177
console.log('Skipping Docker test - Docker not available')
@@ -83,7 +89,7 @@ describe('dynamodb-tooling', () => {
8389
const checkResult = Bun.spawnSync(['docker', 'ps', '-q', '-f', `name=dynamodb-local-${testPort}`])
8490
const containerId = checkResult.stdout.toString().trim()
8591
expect(containerId.length).toBeGreaterThan(0)
86-
})
92+
}, DOCKER_TIMEOUT_MS)
8793

8894
it('should not launch a second instance on the same port', async () => {
8995
if (!dockerAvailable) {
@@ -93,7 +99,7 @@ describe('dynamodb-tooling', () => {
9399

94100
const secondProcess = await dynamoDb.launch({ port: testPort, useDocker: true })
95101
expect(String(secondProcess?.pid)).toBe(String(process?.pid))
96-
})
102+
}, DOCKER_TIMEOUT_MS)
97103

98104
it('should stop DynamoDB Local', () => {
99105
if (!dockerAvailable) {
@@ -108,7 +114,7 @@ describe('dynamodb-tooling', () => {
108114
const checkResult = Bun.spawnSync(['docker', 'ps', '-q', '-f', `name=dynamodb-local-${testPort}`])
109115
const containerId = checkResult.stdout.toString().trim()
110116
expect(containerId.length).toBe(0)
111-
})
117+
}, DOCKER_TIMEOUT_MS)
112118
})
113119

114120
describe('DynamoDB Local (Java) - Mocked Install', () => {

0 commit comments

Comments
 (0)