Skip to content

Unable to use some testcontainers-modules in certain environments #793

@Flowneee

Description

@Flowneee

Problem

Hi. I am currently experiencing some problems with some containers from testcontainers-modules - they are just not starting, specifically postgres and vault (current issue is NOT about these modules, I'll send additional issues and PRs to appropriate repo).

What was weird is that they worked fine on my laptop, but didn't work in our company's Gitlab. After some research I found out that our Gitlab CI uses Kubernetes Executor, and for some reason images there output both stdout and stderr into stderr, I am not sure why and who is to blame here, that is not the point.

But Rust implementation of testcontainers is the only one having problems in this situation - Java, Go, Python are fine.I am not sure how testcontainers-rs WaitFor strategy is different from other languages, but it seems to be implemented not the same way.

I had to fork postgres container and remove this line, leaving only stderr check, to make it work.

Proposal

I am proposing to allow customization of ready conditions through ImageExt, this will allow:

  • cover such cases with weird environments;
  • users to use newer tags (when they need specific software version) where existing ready conditions are simply not working, for example when log line is changed or readiness probe endpoint changed.

Alternative is to introduce LogWaitStrategy::Both, which will read both stdout and stderr and match on combined output.

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