From ea78fa219d6fa49576a8b755c586b8763b44185c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fitcan=20=C3=96zt=C3=BCrk?= <318303091+yigitcan-ozturk@users.noreply.github.com> Date: Tue, 8 Sep 2026 15:41:46 +0300 Subject: [PATCH 1/2] test: wait for gRPC teardown in OTLP functional client --- functional/otlp/func_grpc_main.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/functional/otlp/func_grpc_main.cc b/functional/otlp/func_grpc_main.cc index e285f2c1f9..059c59d93a 100644 --- a/functional/otlp/func_grpc_main.cc +++ b/functional/otlp/func_grpc_main.cc @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include #include #include #include @@ -434,7 +435,16 @@ int main(int argc, char *argv[]) internal_log::GlobalLogHandler::SetLogHandler(log_handler); internal_log::GlobalLogHandler::SetLogLevel(internal_log::LogLevel::Debug); + // Keep one explicit gRPC runtime reference for the lifetime of the functional test. + // Channel construction owns additional references internally, but their final release may + // start asynchronous global teardown just as this short-lived process is returning. The TLS + // failure cases exercise gRPC background work heavily enough that this has intermittently + // raced process exit in CI. Holding our own reference lets us destroy every OpenTelemetry/gRPC + // object first, then wait for the final gRPC teardown to complete before leaving main(). + grpc_init(); rc = run_test_case(opt_test_name); + grpc_shutdown_blocking(); + return rc; } From d7e3b3be8667c5915f9d330e4cd28e227fd16437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fitcan=20=C3=96zt=C3=BCrk?= <318303091+yigitcan-ozturk@users.noreply.github.com> Date: Thu, 10 Sep 2026 02:05:12 +0300 Subject: [PATCH 2/2] style: apply clang-format include order --- functional/otlp/func_grpc_main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functional/otlp/func_grpc_main.cc b/functional/otlp/func_grpc_main.cc index 059c59d93a..29677d08a6 100644 --- a/functional/otlp/func_grpc_main.cc +++ b/functional/otlp/func_grpc_main.cc @@ -1,8 +1,8 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -#include #include +#include #include #include #include