Commit c99693ff23ac1669ff07f494f4c0d0e8c8e7876e
1 parent
99b8b9f9
Exists in
master
and in
29 other branches
Make performance test more reliable
Run each request 10 times to avoid failure because of outliers (ActionItem1617)
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
test/integration/performance_test.rb
... | ... | @@ -29,13 +29,13 @@ class PerformanceTest < ActionController::IntegrationTest |
29 | 29 | create_posts(person2, 100) |
30 | 30 | |
31 | 31 | # no posts |
32 | - time0 = (Benchmark.measure { get '/person0/blog' }) | |
32 | + time0 = (Benchmark.measure { 10.times { get '/person0/blog' } }) | |
33 | 33 | |
34 | 34 | # first 50 |
35 | - time1 = (Benchmark.measure { get '/person1/blog' }) | |
35 | + time1 = (Benchmark.measure { 10.times { get '/person1/blog' } }) | |
36 | 36 | |
37 | 37 | # another 50 |
38 | - time2 = (Benchmark.measure { get '/person2/blog' }) | |
38 | + time2 = (Benchmark.measure { 10.times { get '/person2/blog' } }) | |
39 | 39 | |
40 | 40 | # should not scale linearly, i.e. the inclination of the first segment must |
41 | 41 | # be a lot higher than the one of the segment segment. To compensate for | ... | ... |