testcontainers-cpp 0.2.0
Native C++20 Testcontainers over the Docker Engine API
Loading...
Searching...
No Matches
testcontainers::wait_for::Command Struct Reference

Wait until a command run inside the container (via exec) exits with code 0. More...

#include <testcontainers/WaitFor.hpp>

Public Attributes

std::vector< std::string > cmd
 argv (exec form, not a shell line)
std::chrono::milliseconds poll_interval {200}
 delay between attempts

Detailed Description

Wait until a command run inside the container (via exec) exits with code 0.

Each attempt runs cmd bounded by the shared startup deadline; a non-zero exit — or a daemon-side failure such as "container is restarting" — means "not ready yet" and the command is retried after poll_interval. The startup-timeout error carries the last completed attempt's exit code and a bounded snippet of its output. An attempt still running when the deadline passes is abandoned client-side but keeps running inside the container, so probe commands should be short-lived. The probe runs without stdin or a TTY, so it works on every transport.

Member Data Documentation

◆ cmd

std::vector<std::string> testcontainers::wait_for::Command::cmd

argv (exec form, not a shell line)

◆ poll_interval

std::chrono::milliseconds testcontainers::wait_for::Command::poll_interval {200}

delay between attempts