discourse/spec
Alan Guo Xiang Tan 50bafd48cd
FIX: Flaky spec due to incorrect Rack response body (#24640)
Why was the problem?

ActiveRecord's query cache for the connection pool wasn't disabled after the
`with a fake provider runs 'other_phase' for enabled auth methods` test
in `omniauth_callbacks_controller_spec.rb` was run. This was because the
Rack response body in `FakeAuthenticator::Strategy::other_phase` did not
adhere to the expected Rack body format which is "typically an Array of
String instances". Because this expectation was broken, it cascaded the
problem down where it resulted in the ActiveRecord's query cache for the
connection pool not being disabled as it normally should when the
response body is closed.

When the query cache is left enabled, common assertions pattern in RSpec
like `expect { something }.to change { Group.count }` will fail since
the query cache is enabled and the call first call to `Group.count` will
cache the result to be reused later on.

To see the bug in action, one can run the following command:

`bundle exec rspec --seed 44747
spec/requests/omniauth_callbacks_controller_spec.rb:1150
spec/models/group_spec.rb:283`
2023-11-30 10:49:55 +08:00
..
fabricators DEV: Housekeeping for CleanUpUploads job (#24361) 2023-11-20 09:50:09 +10:00
fixtures FEATURE: remove category badge style options, set bullet style as default (#24198) 2023-11-13 10:46:15 -05:00
helpers DEV: Simplify ember-cli proxy strategy (#24242) 2023-11-10 11:16:06 +00:00
import_export DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
initializers DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
integration DEV: Convert approve_unless_trust_level to groups (#24357) 2023-11-21 11:31:42 -07:00
integrity DEV: Modernise highlightjs loading (#24197) 2023-11-10 20:39:48 +00:00
jobs DEV: Housekeeping for CleanUpUploads job (#24361) 2023-11-20 09:50:09 +10:00
lib FIX: Further improvements for plugin list (#24622) 2023-11-30 10:53:17 +10:00
mailers FIX: Add higher read & open timeouts for group SMTP emails (#24593) 2023-11-28 15:32:59 +10:00
migrations DEV: Switch over category settings to new table - Part 3 (#20657) 2023-09-12 09:51:49 +08:00
models FIX: Flaky spec due to incorrect Rack response body (#24640) 2023-11-30 10:49:55 +08:00
multisite DEV: Add S3 upload system specs using minio (#22975) 2023-08-23 11:18:33 +10:00
requests FIX: Flaky spec due to incorrect Rack response body (#24640) 2023-11-30 10:49:55 +08:00
script/import_scripts DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
serializers FEATURE: increase tag description limit to 1000 (#24561) 2023-11-28 08:45:40 +11:00
services DEV: update syntax tree to latest (#24623) 2023-11-29 16:38:07 +11:00
support DEV: Pass the user who requested the summary to the strategy. (#24489) 2023-11-21 13:27:27 -03:00
system DEV: Fix `ember/no-private-routing-service` (#24009) 2023-11-29 12:26:52 +01:00
tasks DEV: Remove the transpilation message (#23998) 2023-10-19 01:00:15 +02:00
views FIX: Use subfolder-safe url for category in html view (#24595) 2023-11-28 19:08:14 +08:00
rails_helper.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
regenerate_swagger_docs DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
swagger_helper.rb DEV: Apply syntax_tree formatting to `spec/*` 2023-01-09 11:49:28 +00:00