testcontainers-rs icon indicating copy to clipboard operation
testcontainers-rs copied to clipboard

Container::exec wait conditions are applied to logs from run command instead from exec command

Open zvolin opened this issue 11 months ago • 0 comments

Hey, I've just hit this case where I want to execute some command in container and wait for it to finish. I found it strange that the implementation will try to confront provided ready_conditions with the container logs from the original docker run ... command instead of the ones from docker exec ... command. Is it expected?

E.g. this will hang:

my_container.exec(ExecCommand {
    cmd: "echo 123".into(),
    ready_conditions: vec![WaitFor::message_on_stdout("123")],
});

zvolin avatar Mar 14 '24 14:03 zvolin