Skip to content
代码片段 群组 项目
未验证 提交 5ae4e1fb 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Fix order-dependent ActionCable spec failure

If another spec uses ActionCable before the ActionCable initializer
spec runs, then the current PubSub Redis connection will already be
configured with a memoized identifier. The spec attempts to test a
Redis configuration with a `nil` identifier to support GCP
Memorystore, but for that to work we need to reset the Redis
connection and cause the new config to be used.

This commit fixes the order-dependent test by clearing out the
ActionCable server status before and after the test via
`ActionCable.server.restart`.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/418937
上级 7604353c
No related branches found
No related tags found
无相关合并请求
...@@ -6,8 +6,13 @@ ...@@ -6,8 +6,13 @@
describe '#identifier' do describe '#identifier' do
let!(:original_config) { ::ActionCable::Server::Base.config.cable } let!(:original_config) { ::ActionCable::Server::Base.config.cable }
before do
ActionCable.server.restart
end
after do after do
::ActionCable::Server::Base.config.cable = original_config ::ActionCable::Server::Base.config.cable = original_config
ActionCable.server.restart
end end
context 'when id key is nil on cable.yml' do context 'when id key is nil on cable.yml' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册