From d14927366dfb4fb4547f206a6c25e477a4b7ae45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Wed, 18 Jun 2025 11:37:06 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-tests:=20=D0=BE=D1=81=D1=82=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=B0/=D0=BE=D1=82=D1=81=D1=82=D1=80=D0=B5?= =?UTF-8?q?=D0=BB=20=D0=B4=D0=BE=D1=87=D0=B5=D1=80=D0=BD=D0=B8=D1=85=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81=D0=BE=D0=B2=20=D1=81?= =?UTF-8?q?=20=D0=BE=D0=B6=D0=B8=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Основная цель = обеспечить формирование логов без обрезания хвостов, в том числе при использовании дублирования (tee) и компрессии (lz4/gzip). --- test/osal-unix.c++ | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/osal-unix.c++ b/test/osal-unix.c++ index dd58b827..c1bedd24 100644 --- a/test/osal-unix.c++ +++ b/test/osal-unix.c++ @@ -381,7 +381,28 @@ int osal_actor_start(const actor_config &config, mdbx_pid_t &pid) { actor_status osal_actor_info(const mdbx_pid_t pid) { return children.at(pid); } +static void wait_actors(unsigned timeout) { + for (auto &pair : children) + if (pair.second <= as_running) { + osal_yield(); + mdbx_pid_t pid = 0; + osal_actor_poll(pid, timeout); + if (!pid) + return; + } +} + void osal_killall_actors(void) { + for (auto &pair : children) + kill(pair.first, SIGINT); + + wait_actors(0); + for (auto &pair : children) { + osal_yield(); + kill(pair.first, SIGTERM); + } + + wait_actors(1); for (auto &pair : children) { kill(pair.first, SIGKILL); pair.second = as_killed;