testcontainers-cpp 0.2.0
Native C++20 Testcontainers over the Docker Engine API
Loading...
Searching...
No Matches
WaitFor.hpp File Reference
#include <chrono>
#include <cstdint>
#include <optional>
#include <string>
#include <utility>
#include <variant>
#include <vector>
#include "testcontainers/ContainerPort.hpp"

Classes

struct  testcontainers::wait_for::None
 No readiness condition — start() returns as soon as the container is started. More...
struct  testcontainers::wait_for::LogMessage
 Wait until a substring appears in the container's logs a number of times. More...
struct  testcontainers::wait_for::Duration
 Wait for a fixed duration after start (a coarse fallback strategy). More...
struct  testcontainers::wait_for::Exit
 Wait until the container stops, optionally with a specific exit code. More...
struct  testcontainers::wait_for::Healthcheck
 Wait until the container's Docker health status becomes "healthy". More...
struct  testcontainers::wait_for::Http
 Wait until an HTTP GET to the mapped host port returns expected_status. More...
struct  testcontainers::wait_for::Port
 Wait until the mapped host port for port accepts a TCP connection. More...
struct  testcontainers::wait_for::Command
 Wait until a command run inside the container (via exec) exits with code 0. More...

Namespaces

namespace  testcontainers
namespace  testcontainers::wait_for
 Readiness conditions: the alternative types a WaitFor can hold, plus the convenience factories (below) that build them.

Typedefs

using testcontainers::WaitFor
 A readiness condition: a closed sum of the small wait strategies above, dispatched with std::visit.

Functions

WaitFor testcontainers::wait_for::stdout_message (std::string text, int times=1)
 Wait for text to appear times times on stdout.
WaitFor testcontainers::wait_for::stderr_message (std::string text, int times=1)
 Wait for text to appear times times on stderr.
WaitFor testcontainers::wait_for::log (std::string text, int times=1)
 Wait for text to appear on either stream.
WaitFor testcontainers::wait_for::seconds (int s)
 Wait a fixed number of seconds after start.
WaitFor testcontainers::wait_for::millis (int ms)
 Wait a fixed number of milliseconds after start.
WaitFor testcontainers::wait_for::exit ()
 Wait until the container stops (with any exit code).
WaitFor testcontainers::wait_for::exit_code (std::int64_t code)
 Wait until the container stops with the given exit code.
WaitFor testcontainers::wait_for::healthy ()
 Wait until the container's Docker health becomes "healthy".
WaitFor testcontainers::wait_for::http (std::string path, ContainerPort port, int status=200)
 Wait until an HTTP GET to path on the mapped host port for port returns status.
WaitFor testcontainers::wait_for::listening_port (ContainerPort port)
 Wait until the mapped host port for port accepts a TCP connection.
WaitFor testcontainers::wait_for::successful_command (std::vector< std::string > cmd)
 Wait until cmd (argv form), run inside the container, exits with code 0, e.g.
WaitFor testcontainers::wait_for::successful_shell_command (std::string script)
 Wait until the shell line script, run inside the container via /bin/sh -c, exits with code 0.