Commit f84fae13 authored by Dylan Griffith's avatar Dylan Griffith Committed by Stan Hu

Rename #timeouted -> #timed_out

parent a1c216e5
...@@ -37,7 +37,7 @@ module Clusters ...@@ -37,7 +37,7 @@ module Clusters
end end
def check_timeout def check_timeout
if timeouted? if timed_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 timeouted? def timed_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
......
...@@ -35,7 +35,7 @@ module Clusters ...@@ -35,7 +35,7 @@ module Clusters
end end
def check_timeout def check_timeout
if timeouted? if timed_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 timeouted? def timed_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
......
...@@ -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 :timeouted do trait :timed_out do
installing installing
updated_at { ClusterWaitForAppInstallationWorker::TIMEOUT.ago } updated_at { ClusterWaitForAppInstallationWorker::TIMEOUT.ago }
end end
......
...@@ -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 timeouted' do context 'when not timed_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, :timeouted, :updating) } let(:application) { create(:clusters_applications_helm, :timed_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, :timeouted) } let(:application) { create(:clusters_applications_helm, :timed_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)
......
...@@ -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 timeouted' do context 'when not timed_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, :timeouted, :uninstalling) } let(:application) { create(:clusters_applications_prometheus, :timed_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)
......
...@@ -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
:timeouted | false :timed_out | false
end end
with_them do with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment