test: lib: use unique container name per retry attempt
The container name is generated once before the retry loop, so all retry attempts reuse the same name. Move the name generation inside the loop so each attempt gets a fresh name via the incrementing counter, consistent with the comment "publish port ephemeral, allows parallel instances". Formatting changes (indentation) of lines 208-225 in test/lib/proc_utils.cc will be fixed in the next commit. Refs SCYLLADB-1542
This commit is contained in:
@@ -200,6 +200,11 @@ future<std::tuple<tests::proc::process_fixture, int>> tests::proc::start_docker_
|
||||
}
|
||||
|
||||
static int counter = 0;
|
||||
|
||||
struct in_use{};
|
||||
constexpr auto max_retries = 8;
|
||||
|
||||
for (int retries = 0;; ++retries) {
|
||||
container_name = fmt::format("{}-{}-{}", name, ::getpid(), ++counter);
|
||||
|
||||
// publish port ephemeral, allows parallel instances
|
||||
@@ -219,10 +224,6 @@ future<std::tuple<tests::proc::process_fixture, int>> tests::proc::start_docker_
|
||||
params.emplace_back(image);
|
||||
params.append_range(image_args);
|
||||
|
||||
struct in_use{};
|
||||
constexpr auto max_retries = 8;
|
||||
|
||||
for (int retries = 0;; ++retries) {
|
||||
BOOST_TEST_MESSAGE(fmt::format("Will run {}", params));
|
||||
|
||||
std::vector<std::string> env;
|
||||
|
||||
Reference in New Issue
Block a user