(POOLER-174) Reduce duplicate of on demand code introduced in POOLER-158 (#383)

* (POOLER-174) Reduce duplicate of on demand code introduced in POOLER-158
refactored every parsing of request of type 'pool_alias:pool:count' into a
utility class, that is used by pool_manager and the api v1 class
* add some metrics to the od request generation
* fix rubocop offenses, we are now friends
This commit is contained in:
Samuel 2020-06-11 12:39:34 -05:00 committed by GitHub
parent 2afc2a242b
commit 4ecd5dea51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 21 deletions

View file

@ -4872,6 +4872,14 @@ EOT
end
end
it 'fails if the request is not valid' do
redis_connection_pool.with do |redis|
request_id = "#{request_id}-wrong"
create_ondemand_request_for_test(request_id, current_time.to_i, "#{pool}:5", redis)
expect{subject.vms_ready?(request_id, redis)}.to raise_error(ArgumentError)
end
end
it 'returns false when vms for request_id are not ready' do
redis_connection_pool.with do |redis|
result = subject.vms_ready?(request_id, redis)