Skip to content

Commit afec496

Browse files
committed
fix: Add timeout when stopping in test
1 parent be60b45 commit afec496

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

packages/testcontainers/src/generic-container/generic-container-reuse.test.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,7 @@ describe("GenericContainer reuse", () => {
116116
.withExposedPorts(8080)
117117
.withReuse()
118118
.start();
119-
await container1.stop({ remove: false });
120-
121-
// Wait for the container to be stopped, seems to be asynchronous
122-
const status = await new IntervalRetry<string, string>(10).retryUntil(
123-
() =>
124-
client.container
125-
.getById(container1.getId())
126-
.inspect()
127-
.then((i) => i.State.Status)
128-
.catch(() => "failed"),
129-
(status) => status === "exited",
130-
() => "timeout",
131-
500
132-
);
133-
134-
expect(status).toBe("exited");
119+
await container1.stop({ remove: false, timeout: 10000 });
135120

136121
const container2 = await new GenericContainer("cristianrgreco/testcontainer:1.1.14")
137122
.withName("there_can_only_be_one")

0 commit comments

Comments
 (0)