From 0f8254710ac50ef3b322de1b1bd0e35bd0707577 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois-Simon=20Fauteux-Chapleau?=
 <francois-simon.fauteux-chapleau@savoirfairelinux.com>
Date: Wed, 27 Mar 2024 16:19:37 -0400
Subject: [PATCH] tests: fix UPnPContext shutdown timeout in ICE tests

Change-Id: I9a2ceb1bab75a87c0bf4af24c414a2819899729f
---
 tests/ice.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/ice.cpp b/tests/ice.cpp
index 9873bdb..32928af 100644
--- a/tests/ice.cpp
+++ b/tests/ice.cpp
@@ -92,7 +92,10 @@ IceTest::setUp()
     if (!upnpContext) {
         if (!ioContext) {
             ioContext = std::make_shared<asio::io_context>();
-            ioContextRunner = std::make_shared<std::thread>([&] { ioContext->run(); });
+            ioContextRunner = std::make_shared<std::thread>([&] {
+                auto work = asio::make_work_guard(*ioContext);
+                ioContext->run();
+            });
         }
         upnpContext = std::make_shared<dhtnet::upnp::UPnPContext>(ioContext, nullptr);
     }
-- 
GitLab