Skip to content

Fix false negative in project_events_spec.rb

Thong Kuah requested to merge fix_false_negative_project_events_spec into master

What does this MR do and why?

Fix false negative in project_events_spec.rb.

After using let_it_be, I discovered that the N+1 spec started failing because the control now has less queries.

Unfortunately, it turns out that we do indeed have an N+1 but it's too hard to fix for now.

Screenshots or screen recordings

Before:

$ time be rspec spec/requests/api/project_events_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Test environment set up in 5.30844 seconds
...........

Finished in 18.99 seconds (files took 12.72 seconds to load)
11 examples, 0 failures

[TEST PROF INFO] Time spent in factories: 00:05.757 (27.44% of total time)

real	0m32.990s
user	0m22.328s
sys	0m13.458s

After:

$ time be rspec spec/requests/api/project_events_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Test environment set up in 4.389354 seconds
...........

Finished in 15.31 seconds (files took 11.82 seconds to load)
11 examples, 0 failures

[TEST PROF INFO] Time spent in factories: 00:02.757 (16.12% of total time)

real	0m28.319s
user	0m18.161s
sys	0m11.981s

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports