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

Fix order-dependent test failures in Redis/Sidekiq specs

Previously the second test would fail if you did this:

```
bundle exec rspec spec/lib/gitlab/redis/queues_spec.rb \
  spec/lib/gitlab/sidekiq_queue_spec.rb
```

This happens because the `@instances` class variable is memoized
by the first spec with some temporary settings. Clear this out
to ensure this doesn't pollute the global state.
上级 40349a55
No related branches found
No related tags found
无相关合并请求
......@@ -60,6 +60,10 @@
described_class.remove_instance_variable(:@instances) if described_class.instance_variable_defined?(:@instances)
end
after do
described_class.remove_instance_variable(:@instances) if described_class.instance_variable_defined?(:@instances)
end
shared_examples 'no extra shards' do
it 'returns a single map of self' do
expect(described_class.instances).to eq({ 'main' => described_class })
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册