Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug: testcontainers.core.waiting_utils.wait_for_logs keeps waiting despite the container has exited. #681

@ArthurBook

Description

@ArthurBook

Describe the bug

The testcontainers.core.waiting_utils.wait_for_logs keeps waiting despite the container has exited. This can be confusing if there is a long wait time.

To Reproduce

from testcontainers.core import container, waiting_utils

if __name__ == "__main__":
    waiting_utils.wait_for_logs(
        container.DockerContainer("flyway/flyway").start(),
        r"Successfully applied \d+ migrations to schema",
        timeout=large_n, # 
    )

# >> Raised Exception has occurred: TimeoutError Container did not emit logs satisfying predicate in `large_n` seconds

Runtime environment

Python:         3.11.9
testcontainers  4.7.2
Implementation: CPython

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions