Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.9
obs-server
obs-server-2.9-0032-ci-Actually-wait-for-schedu...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.9-0032-ci-Actually-wait-for-scheduler-when-test-backend-is-.patch of Package obs-server
From 6890a383ceb1e8bc1d9d0bc6b22131ac8100daaa Mon Sep 17 00:00:00 2001 From: Oleg Girko <ol@infoserver.lv> Date: Mon, 15 Oct 2018 01:01:02 +0100 Subject: [PATCH] [ci] Actually wait for scheduler when test backend is already started. There are two ways to start test backend: waiting for scheduler startup completion (with :wait_for_scheduler option) and not waiting (without :wait_for_scheduler option). The problem is that if test backend is already started without waiting for scheduler, subsequent calls to Backend::Test.start do nothing even with :wait_for_scheduler option. This causes a race condition when a test needs scheduler startup to be complete, but test backend was started earlier without waiting for scheduler startup. The test proceeds and interferes with scheduler startup, causing an exception in scheduler monitor thread that crashes entire test backend. This change fixes this problem by waiting for scheduler startup if test backend is already started and :wait_for_scheduler option is specified. Signed-off-by: Oleg Girko <ol@infoserver.lv> --- src/api/lib/backend/test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/lib/backend/test.rb b/src/api/lib/backend/test.rb index 6a80916339..c8fbd3fe3a 100644 --- a/src/api/lib/backend/test.rb +++ b/src/api/lib/backend/test.rb @@ -8,6 +8,7 @@ module Backend return unless Rails.env.test? if @backend raise 'Backend died' if @backend == :backend_died + wait_for_scheduler if options[:wait_for_scheduler] && @backend.is_a?(IO) return end return if ENV['BACKEND_STARTED'] @@ -49,6 +50,10 @@ module Backend # make sure it's actually tried to start return unless options[:wait_for_scheduler] + wait_for_scheduler + end + + def self.wait_for_scheduler Rails.logger.debug 'Wait for scheduler thread to finish start' counter = 0 marker = Rails.root.join('tmp', 'scheduler.done') -- 2.20.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor