File obs-server-2.10-0029-ci-Limit-time-waiting-for-scheduler-thread-to-finish.patch of Package obs-server

From dded4326bfc725524ae388b4995508026eda3238 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Fri, 14 May 2021 01:44:31 +0100
Subject: [PATCH] [ci] Limit time waiting for scheduler thread to finish.

Sometimes scheduler thread in "start_test_backend" script can
take too long to wait to update notification events
because default timeout for API requests to backend is too long
(1000 seconds).

As waiting for this thread to finish happens at exit anyway,
it makes no sense to wait for too long.

This change limits wait time to just 60 seconds.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 src/api/script/start_test_backend | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/api/script/start_test_backend b/src/api/script/start_test_backend
index 1a9079f4d6..df1f555d6b 100755
--- a/src/api/script/start_test_backend
+++ b/src/api/script/start_test_backend
@@ -326,7 +326,7 @@ User.session = nil
 scheduler_thread = nil
 
 at_exit do
-  scheduler_thread.join if scheduler_thread
+  scheduler_thread.join(60) if scheduler_thread
 
   system("cd #{backend_config}; exec ./bs_srcserver --stop")
   system("cd #{backend_config}; exec ./bs_repserver --stop")
-- 
2.31.1