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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
f84fae13
Commit
f84fae13
authored
Apr 29, 2019
by
Dylan Griffith
Committed by
Stan Hu
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename #timeouted -> #timed_out
parent
a1c216e5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
app/services/clusters/applications/check_installation_progress_service.rb
...sters/applications/check_installation_progress_service.rb
+2
-2
app/services/clusters/applications/check_uninstall_progress_service.rb
...clusters/applications/check_uninstall_progress_service.rb
+2
-2
spec/factories/clusters/applications/helm.rb
spec/factories/clusters/applications/helm.rb
+1
-1
spec/services/clusters/applications/check_installation_progress_service_spec.rb
.../applications/check_installation_progress_service_spec.rb
+3
-3
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
...ers/applications/check_uninstall_progress_service_spec.rb
+2
-2
spec/support/shared_examples/models/cluster_application_status_shared_examples.rb
...ples/models/cluster_application_status_shared_examples.rb
+1
-1
No files found.
app/services/clusters/applications/check_installation_progress_service.rb
View file @
f84fae13
...
@@ -37,7 +37,7 @@ module Clusters
...
@@ -37,7 +37,7 @@ module Clusters
end
end
def
check_timeout
def
check_timeout
if
time
outed
?
if
time
d_out
?
begin
begin
app
.
make_errored!
(
"Operation timed out. Check pod logs for
#{
pod_name
}
for more details."
)
app
.
make_errored!
(
"Operation timed out. Check pod logs for
#{
pod_name
}
for more details."
)
end
end
...
@@ -51,7 +51,7 @@ module Clusters
...
@@ -51,7 +51,7 @@ module Clusters
install_command
.
pod_name
install_command
.
pod_name
end
end
def
time
outed
?
def
time
d_out
?
Time
.
now
.
utc
-
app
.
updated_at
.
to_time
.
utc
>
ClusterWaitForAppInstallationWorker
::
TIMEOUT
Time
.
now
.
utc
-
app
.
updated_at
.
to_time
.
utc
>
ClusterWaitForAppInstallationWorker
::
TIMEOUT
end
end
...
...
app/services/clusters/applications/check_uninstall_progress_service.rb
View file @
f84fae13
...
@@ -35,7 +35,7 @@ module Clusters
...
@@ -35,7 +35,7 @@ module Clusters
end
end
def
check_timeout
def
check_timeout
if
time
outed
?
if
time
d_out
?
app
.
make_errored!
(
"Operation timed out. Check pod logs for
#{
pod_name
}
for more details."
)
app
.
make_errored!
(
"Operation timed out. Check pod logs for
#{
pod_name
}
for more details."
)
else
else
WaitForUninstallAppWorker
.
perform_in
(
WaitForUninstallAppWorker
::
INTERVAL
,
app
.
name
,
app
.
id
)
WaitForUninstallAppWorker
.
perform_in
(
WaitForUninstallAppWorker
::
INTERVAL
,
app
.
name
,
app
.
id
)
...
@@ -46,7 +46,7 @@ module Clusters
...
@@ -46,7 +46,7 @@ module Clusters
app
.
uninstall_command
.
pod_name
app
.
uninstall_command
.
pod_name
end
end
def
time
outed
?
def
time
d_out
?
Time
.
now
.
utc
-
app
.
updated_at
.
to_time
.
utc
>
WaitForUninstallAppWorker
::
TIMEOUT
Time
.
now
.
utc
-
app
.
updated_at
.
to_time
.
utc
>
WaitForUninstallAppWorker
::
TIMEOUT
end
end
...
...
spec/factories/clusters/applications/helm.rb
View file @
f84fae13
...
@@ -49,7 +49,7 @@ FactoryBot.define do
...
@@ -49,7 +49,7 @@ FactoryBot.define do
status_reason
'something went wrong'
status_reason
'something went wrong'
end
end
trait
:time
outed
do
trait
:time
d_out
do
installing
installing
updated_at
{
ClusterWaitForAppInstallationWorker
::
TIMEOUT
.
ago
}
updated_at
{
ClusterWaitForAppInstallationWorker
::
TIMEOUT
.
ago
}
end
end
...
...
spec/services/clusters/applications/check_installation_progress_service_spec.rb
View file @
f84fae13
...
@@ -18,7 +18,7 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do
...
@@ -18,7 +18,7 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do
end
end
context
"when phase is
#{
a_phase
}
"
do
context
"when phase is
#{
a_phase
}
"
do
context
'when not time
outed
'
do
context
'when not time
d_out
'
do
it
'reschedule a new check'
do
it
'reschedule a new check'
do
expect
(
ClusterWaitForAppInstallationWorker
).
to
receive
(
:perform_in
).
once
expect
(
ClusterWaitForAppInstallationWorker
).
to
receive
(
:perform_in
).
once
expect
(
service
).
not_to
receive
(
:remove_installation_pod
)
expect
(
service
).
not_to
receive
(
:remove_installation_pod
)
...
@@ -113,7 +113,7 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do
...
@@ -113,7 +113,7 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do
end
end
context
'when timed out'
do
context
'when timed out'
do
let
(
:application
)
{
create
(
:clusters_applications_helm
,
:time
outed
,
:updating
)
}
let
(
:application
)
{
create
(
:clusters_applications_helm
,
:time
d_out
,
:updating
)
}
before
do
before
do
expect
(
service
).
to
receive
(
:installation_phase
).
once
.
and_return
(
phase
)
expect
(
service
).
to
receive
(
:installation_phase
).
once
.
and_return
(
phase
)
...
@@ -174,7 +174,7 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do
...
@@ -174,7 +174,7 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do
end
end
context
'when timed out'
do
context
'when timed out'
do
let
(
:application
)
{
create
(
:clusters_applications_helm
,
:time
outed
)
}
let
(
:application
)
{
create
(
:clusters_applications_helm
,
:time
d_out
)
}
before
do
before
do
expect
(
service
).
to
receive
(
:installation_phase
).
once
.
and_return
(
phase
)
expect
(
service
).
to
receive
(
:installation_phase
).
once
.
and_return
(
phase
)
...
...
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
View file @
f84fae13
...
@@ -24,7 +24,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
...
@@ -24,7 +24,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
end
end
context
"when phase is
#{
a_phase
}
"
do
context
"when phase is
#{
a_phase
}
"
do
context
'when not time
outed
'
do
context
'when not time
d_out
'
do
it
'reschedule a new check'
do
it
'reschedule a new check'
do
expect
(
worker_class
).
to
receive
(
:perform_in
).
once
expect
(
worker_class
).
to
receive
(
:perform_in
).
once
expect
(
service
).
not_to
receive
(
:remove_installation_pod
)
expect
(
service
).
not_to
receive
(
:remove_installation_pod
)
...
@@ -100,7 +100,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
...
@@ -100,7 +100,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
end
end
context
'when timed out'
do
context
'when timed out'
do
let
(
:application
)
{
create
(
:clusters_applications_prometheus
,
:time
outed
,
:uninstalling
)
}
let
(
:application
)
{
create
(
:clusters_applications_prometheus
,
:time
d_out
,
:uninstalling
)
}
before
do
before
do
expect
(
service
).
to
receive
(
:installation_phase
).
once
.
and_return
(
phase
)
expect
(
service
).
to
receive
(
:installation_phase
).
once
.
and_return
(
phase
)
...
...
spec/support/shared_examples/models/cluster_application_status_shared_examples.rb
View file @
f84fae13
...
@@ -209,7 +209,7 @@ shared_examples 'cluster application status specs' do |application_name|
...
@@ -209,7 +209,7 @@ shared_examples 'cluster application status specs' do |application_name|
:update_errored
|
false
:update_errored
|
false
:uninstalling
|
false
:uninstalling
|
false
:uninstall_errored
|
false
:uninstall_errored
|
false
:time
outed
|
false
:time
d_out
|
false
end
end
with_them
do
with_them
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