diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-18 14:57:35 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-23 12:02:23 +0300 |
commit | 1881d4f8ecbf52afd7bc732cd6c1296fafd38405 (patch) | |
tree | 95d7c74ceac860f5366a3e3e8c357eae1453fc41 /spec | |
parent | 08033d3d24dca65350d0b3c6a1045a511219c9c3 (diff) | |
download | gitlab-ce-1881d4f8ecbf52afd7bc732cd6c1296fafd38405.tar.gz |
Allow configuring new circuitbreaker settings from the UI and API
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/application_setting_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 30495fd4f5e..47b7150d36f 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -115,7 +115,8 @@ describe ApplicationSetting do end context 'circuitbreaker settings' do - [:circuitbreaker_failure_count_threshold, + [:circuitbreaker_backoff_threshold, + :circuitbreaker_failure_count_threshold, :circuitbreaker_failure_wait_time, :circuitbreaker_failure_reset_time, :circuitbreaker_storage_timeout].each do |field| @@ -125,6 +126,16 @@ describe ApplicationSetting do .is_greater_than_or_equal_to(0) end end + + it 'requires the `backoff_threshold` to be lower than the `failure_count_threshold`' do + setting.circuitbreaker_failure_count_threshold = 10 + setting.circuitbreaker_backoff_threshold = 15 + failure_message = "The circuitbreaker backoff threshold should be lower "\ + "than the failure count threshold" + + expect(setting).not_to be_valid + expect(setting.errors[:circuitbreaker_backoff_threshold]).to include(failure_message) + end end context 'repository storages' do |