File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
packages/testcontainers/src
container-runtime/clients/container Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -291,9 +291,14 @@ export class DockerContainerClient implements ContainerClient {
291291 log . debug ( `Removing container...` , { containerId : container . id } ) ;
292292 await container . remove ( { v : opts ?. removeVolumes } ) ;
293293 log . debug ( `Removed container` , { containerId : container . id } ) ;
294- } catch ( err ) {
295- log . error ( `Failed to remove container: ${ err } ` , { containerId : container . id } ) ;
296- throw err ;
294+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
295+ } catch ( err : any ) {
296+ if ( err . statusCode === 404 ) {
297+ log . warn ( `Failed to remove container as it no longer exists: ${ err } ` , { containerId : container . id } ) ;
298+ } else {
299+ log . error ( `Failed to remove container: ${ err } ` , { containerId : container . id } ) ;
300+ throw err ;
301+ }
297302 }
298303 }
299304
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export async function getReaper(client: ContainerRuntimeClient): Promise<Reaper>
3232 const reaperContainer = await findReaperContainer ( client ) ;
3333 sessionId = reaperContainer ?. Labels [ LABEL_TESTCONTAINERS_SESSION_ID ] ?? new RandomUuid ( ) . nextUuid ( ) ;
3434
35- if ( process . env . TESTCONTAINERS_RYUK_DISABLED === "true" ) {
35+ if ( process . env . TESTCONTAINERS_RYUK_DISABLED === "true" || process . versions . bun ) {
3636 return new DisabledReaper ( sessionId , "" ) ;
3737 } else if ( reaperContainer ) {
3838 return await useExistingReaper ( reaperContainer , sessionId , client . info . containerRuntime . host ) ;
You can’t perform that action at this time.
0 commit comments