Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #33430 - do not error on pulpcore with 1 worker #9618

Merged
merged 1 commit into from Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/models/katello/ping.rb
Expand Up @@ -195,10 +195,7 @@ def pulp3_without_auth(url)
end

workers = json["online_workers"] || []

unless workers.count > 1
fail _("Not all necessary pulp workers running at %s.") % url
end
fail _("No pulpcore workers are running at %s.") % url if workers.empty?

json
end
Expand Down
15 changes: 4 additions & 11 deletions test/models/ping_test.rb
Expand Up @@ -220,28 +220,21 @@ def test_failure_on_bad_redis
def test_failure_on_all_workers
run_exception_test({ "database_connection" => {"connected" => true},
"redis_connection" => {"connected" => true}
}, /Not all necessary pulp workers running/)
}, /No pulpcore workers are running at/)
end

def test_failure_on_all_workers_empty
run_exception_test({ "database_connection" => {"connected" => true},
"redis_connection" => {"connected" => true},
"online_workers" => []
}, /Not all necessary pulp workers running/)
end

def test_failure_on_no_resource_manager
run_exception_test({ "database_connection" => {"connected" => true},
"redis_connection" => {"connected" => true},
"online_workers" => [{"name" => "reserved_resource_worker-1"}]
}, /Not all necessary pulp workers running/)
}, /No pulpcore workers are running at/)
end

def test_failure_on_no_reserved_resource_worker
run_exception_test({ "database_connection" => {"connected" => true},
"redis_connection" => {"connected" => true},
"online_workers" => [{"name" => "resource_manager"}]
}, /Not all necessary pulp workers running/)
"online_workers" => []
}, /No pulpcore workers are running at/)
end

def test_all_workers_present_ok_status
Expand Down