summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Lopez <fjlopez@gitlab.com>2017-11-07 11:58:10 +0100
committerFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 10:00:08 +0100
commitc491b9505ad9992b1e939c9ba858db9d4f8cc090 (patch)
tree0f9190353e56bab63f372f1958821d695b7104ab
parentd948e6791300b14d18b95881290ccfcba7928ea0 (diff)
downloadgitlab-ce-c491b9505ad9992b1e939c9ba858db9d4f8cc090.tar.gz
Pushing to see how this tests behaves
-rw-r--r--spec/requests/rack_attack_global_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/requests/rack_attack_global_spec.rb b/spec/requests/rack_attack_global_spec.rb
index 95a607ac8fd..6984ff4ab36 100644
--- a/spec/requests/rack_attack_global_spec.rb
+++ b/spec/requests/rack_attack_global_spec.rb
@@ -91,7 +91,7 @@ describe 'Rack Attack global throttles' do
expect_rejection { get(*get_args) }
- Timecop.travel((NEXT_TIME_PERIOD_BUFFER + period).from_now) do
+ Timecop.travel(period.from_now) do
requests_per_period.times do
get(*get_args)
expect(response).to have_http_status 200
@@ -171,7 +171,7 @@ describe 'Rack Attack global throttles' do
expect_rejection { get url_that_does_not_require_authentication }
- Timecop.travel((NEXT_TIME_PERIOD_BUFFER + period).from_now) do
+ Timecop.travel(period.from_now) do
requests_per_period.times do
get url_that_does_not_require_authentication
expect(response).to have_http_status 200
@@ -334,7 +334,7 @@ describe 'Rack Attack global throttles' do
expect_rejection { get url_that_requires_authentication }
- Timecop.travel((NEXT_TIME_PERIOD_BUFFER + period).from_now) do
+ Timecop.travel(period.from_now) do
requests_per_period.times do
get url_that_requires_authentication
expect(response).to have_http_status 200
@@ -405,11 +405,11 @@ describe 'Rack Attack global throttles' do
end
def expect_rejection(&block)
- NUM_TRIES_FOR_REJECTION.times do |i|
+ # NUM_TRIES_FOR_REJECTION.times do |i|
yield
- break if response.status == 429 # success
- Rails.logger.warn "Flaky test expected HTTP status 429 but got #{response.status}. Will attempt again (#{i + 1}/#{NUM_TRIES_FOR_REJECTION})" if i + 1 < NUM_TRIES_FOR_REJECTION
- end
+ # break if response.status == 429 # success
+ # Rails.logger.warn "Flaky test expected HTTP status 429 but got #{response.status}. Will attempt again (#{i + 1}/#{NUM_TRIES_FOR_REJECTION})" if i + 1 < NUM_TRIES_FOR_REJECTION
+ # end
expect(response).to have_http_status(429)
end