diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-08-13 14:52:44 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-08-16 14:15:50 +0200 |
commit | ee603a0089520ae22a97d9f5f5d7d083c2fe24ce (patch) | |
tree | 984172075e46425056f1318fcaa29c886ae00ad9 /spec/support/stub_configuration.rb | |
parent | 2b950014c35534c817c58ebf43dcbf4bbf490b9e (diff) | |
download | gitlab-ce-ee603a0089520ae22a97d9f5f5d7d083c2fe24ce.tar.gz |
Allow a `failure_wait_time` of 0 for storage access
This allows testing every storage attempt after a failure. Which could
be useful for tests
Diffstat (limited to 'spec/support/stub_configuration.rb')
-rw-r--r-- | spec/support/stub_configuration.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/support/stub_configuration.rb b/spec/support/stub_configuration.rb index 37c89d37aa0..45c10e78789 100644 --- a/spec/support/stub_configuration.rb +++ b/spec/support/stub_configuration.rb @@ -39,14 +39,17 @@ module StubConfiguration end def stub_storage_settings(messages) + # Default storage is always required + messages['default'] ||= Gitlab.config.repositories.storages.default messages.each do |storage_name, storage_settings| + storage_settings['path'] ||= TestEnv.repos_path storage_settings['failure_count_threshold'] ||= 10 storage_settings['failure_wait_time'] ||= 30 storage_settings['failure_reset_time'] ||= 1800 storage_settings['storage_timeout'] ||= 5 end - allow(Gitlab.config.repositories).to receive(:storages).and_return(messages) + allow(Gitlab.config.repositories).to receive(:storages).and_return(Settingslogic.new(messages)) end private |