summaryrefslogtreecommitdiff
path: root/spec/features/projects/clusters
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-07-24 15:27:53 +0100
committerDylan Griffith <dyl.griffith@gmail.com>2018-07-30 13:08:31 +0000
commitab5c97b126567ef5c0482339a127e979d6c8c661 (patch)
tree35166c8047d9b101bd20af85c718b04d025cf32f /spec/features/projects/clusters
parent11edbcccef37f08b089386c41d3914df7f48a677 (diff)
downloadgitlab-ce-ab5c97b126567ef5c0482339a127e979d6c8c661.tar.gz
Fix race condition in spec/features/projects/clusters/applications_spec.rb
This was not happening very often but with the previous changes to create SSL certs for helm tiller it takes long enough to be created that we see the test failing a lot more
Diffstat (limited to 'spec/features/projects/clusters')
-rw-r--r--spec/features/projects/clusters/applications_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/features/projects/clusters/applications_spec.rb b/spec/features/projects/clusters/applications_spec.rb
index a65ca662350..99c6b450633 100644
--- a/spec/features/projects/clusters/applications_spec.rb
+++ b/spec/features/projects/clusters/applications_spec.rb
@@ -46,12 +46,14 @@ describe 'Clusters Applications', :js do
end
end
- it 'he sees status transition' do
+ it 'they see status transition' do
page.within('.js-cluster-application-row-helm') do
# FE sends request and gets the response, then the buttons is "Install"
expect(page.find(:css, '.js-cluster-application-install-button')['disabled']).to eq('true')
expect(page).to have_css('.js-cluster-application-install-button', exact_text: 'Install')
+ wait_until_helm_created!
+
Clusters::Cluster.last.application_helm.make_installing!
# FE starts polling and update the buttons to "Installing"
@@ -83,7 +85,7 @@ describe 'Clusters Applications', :js do
end
end
- it 'he sees status transition' do
+ it 'they see status transition' do
page.within('.js-cluster-application-row-ingress') do
# FE sends request and gets the response, then the buttons is "Install"
expect(page).to have_css('.js-cluster-application-install-button[disabled]')
@@ -116,4 +118,12 @@ describe 'Clusters Applications', :js do
end
end
end
+
+ def wait_until_helm_created!
+ retries = 0
+ while Clusters::Cluster.last.application_helm.nil? do
+ raise "Timed out waiting for helm application to be created in DB" if (retries += 1) > 3
+ sleep(1)
+ end
+ end
end