Skip to content

OneShotStartupCheckStrategy fails if the container is already gone #1331

@bsideup

Description

@bsideup

Consider the following test:

    @Test(timeout = 5_000)
    public void testExitingContainer() {
        try (
            GenericContainer container = new GenericContainer<>()
                .withCreateContainerCmdModifier(it -> it.getHostConfig().withAutoRemove(true))
                .withStartupCheckStrategy(new OneShotStartupCheckStrategy())
        ) {
            container.start();
        }
    }

It will fail because the container exits immediately and OneShotStartupCheckStrategy receives NotFoundException.

The question is - what should we do? StartupStatus.SUCCESSFUL or StartupStatus.FAILED?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions