Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d0e94d6d
Commit
d0e94d6d
authored
Dec 14, 2021
by
Aleksei Lipniagov
Committed by
Rémy Coutable
Dec 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky Redis-Sessions spec
parent
fc277453
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
spec/lib/gitlab/redis/sessions_spec.rb
spec/lib/gitlab/redis/sessions_spec.rb
+8
-5
spec/support/redis/redis_new_instance_shared_examples.rb
spec/support/redis/redis_new_instance_shared_examples.rb
+7
-1
No files found.
spec/lib/gitlab/redis/sessions_spec.rb
View file @
d0e94d6d
...
...
@@ -44,20 +44,23 @@ RSpec.describe Gitlab::Redis::Sessions do
describe
'#store'
do
subject
{
described_class
.
store
(
namespace:
described_class
::
SESSION_NAMESPACE
)
}
context
'when redis.sessions configuration is provided'
do
context
'when redis.sessions configuration is
NOT
provided'
do
it
'instantiates ::Redis instance'
do
expect
(
described_class
).
to
receive
(
:config_fallback?
).
and_return
(
true
)
expect
(
subject
).
to
be_instance_of
(
::
Redis
::
Store
)
end
end
context
'when redis.sessions configuration is not provided'
do
context
'when redis.sessions configuration is provided'
do
before
do
allow
(
described_class
).
to
receive
(
:config_fallback?
).
and_return
(
false
)
end
it
'instantiates an instance of MultiStore'
do
expect
(
described_class
).
to
receive
(
:config_fallback?
).
and_return
(
false
)
expect
(
subject
).
to
be_instance_of
(
::
Gitlab
::
Redis
::
MultiStore
)
end
end
it_behaves_like
'multi store feature flags'
,
:use_primary_and_secondary_stores_for_sessions
,
:use_primary_store_as_default_for_sessions
end
end
end
spec/support/redis/redis_new_instance_shared_examples.rb
View file @
d0e94d6d
...
...
@@ -8,10 +8,16 @@ RSpec.shared_examples "redis_new_instance_shared_examples" do |name, fallback_cl
let
(
:fallback_config_file
)
{
nil
}
before
do
fallback_class
.
remove_instance_variable
(
:@_raw_config
)
rescue
nil
allow
(
fallback_class
).
to
receive
(
:config_file_name
).
and_return
(
fallback_config_file
)
end
include_examples
"redis_shared_examples"
after
do
fallback_class
.
remove_instance_variable
(
:@_raw_config
)
rescue
nil
end
it_behaves_like
"redis_shared_examples"
describe
'.config_file_name'
do
subject
{
described_class
.
config_file_name
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment