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
aa00e1b0
Commit
aa00e1b0
authored
May 08, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"Fix" the Geo+Prometheus spec failure by removing prometheus from one of the specs
parent
5bfaaaa3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
ee/spec/requests/api/geo_nodes_spec.rb
ee/spec/requests/api/geo_nodes_spec.rb
+9
-0
ee/spec/services/geo/metrics_update_service_spec.rb
ee/spec/services/geo/metrics_update_service_spec.rb
+5
-9
No files found.
ee/spec/requests/api/geo_nodes_spec.rb
View file @
aa00e1b0
...
@@ -13,6 +13,15 @@ describe API::GeoNodes, :geo, api: true do
...
@@ -13,6 +13,15 @@ describe API::GeoNodes, :geo, api: true do
set
(
:admin
)
{
create
(
:admin
)
}
set
(
:admin
)
{
create
(
:admin
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:user
)
{
create
(
:user
)
}
before
do
# FIXME: Skip creating prometheus metrics in these specs as it interacts
# badly with specs in ee/spec/services/geo/metrics_update_spec.rb - we need
# to learn how to reliably clear prometheus state between specs.
#
# https://gitlab.com/gitlab-org/gitlab-ce/issues/39968
allow
(
Gitlab
::
Metrics
).
to
receive
(
:prometheus_metrics_enabled?
)
{
false
}
end
describe
'GET /geo_nodes'
do
describe
'GET /geo_nodes'
do
it
'retrieves the Geo nodes if admin is logged in'
do
it
'retrieves the Geo nodes if admin is logged in'
do
get
api
(
"/geo_nodes"
,
admin
)
get
api
(
"/geo_nodes"
,
admin
)
...
...
ee/spec/services/geo/metrics_update_service_spec.rb
View file @
aa00e1b0
...
@@ -68,17 +68,13 @@ describe Geo::MetricsUpdateService, :geo do
...
@@ -68,17 +68,13 @@ describe Geo::MetricsUpdateService, :geo do
}
}
end
end
def
reset_prometheus_metrics
# FIXME: we don't clear prometheus state between specs, so these specs below
matching_files
=
File
.
join
(
::
Prometheus
::
Client
.
configuration
.
multiprocess_files_dir
,
"*.db"
)
# create *persistent* entries in the prometheus database that may cause other
Dir
[
matching_files
].
map
{
|
filename
|
File
.
delete
(
filename
)
if
File
.
file?
(
filename
)
}
# specs to transiently fail.
#
# Can't use ::Prometheus::Client.reinitialize_on_pid_change because the PID didn't change
# Issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/39968
::
Prometheus
::
Client
::
MmapedValue
.
reset_and_reinitialize
end
before
do
before
do
allow
(
Gitlab
::
Metrics
).
to
receive
(
:prometheus_metrics_enabled?
).
and_return
(
true
)
allow
(
Gitlab
::
Metrics
).
to
receive
(
:prometheus_metrics_enabled?
).
and_return
(
true
)
reset_prometheus_metrics
end
end
describe
'#execute'
do
describe
'#execute'
do
...
...
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