Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PE-14934) Add more robust puppetdb check #3

Conversation

demophoon
Copy link
Contributor

Before this commit we were still failing before the last puppet agent
run in do_install because we also run puppet agent in some cases before
the last run. This commit adds in the wait during that agent run as well
as a check on the status endpoint in puppetdb to be sure that it is
running in the case that the port is open but puppetdb is not ready for
requests.

while not match
output = on(host, "curl -s http://localhost:8080/pdb/meta/v1/version", :accept_all_exit_codes => true)
match = output.stdout =~ /version.*\d+\.\d+\.\d+/
sleep 1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if at first you don't succeed...

@puppetlabs-jenkins
Copy link
Contributor

Can one of the admins verify this patch?

Before this commit we were still failing before the last puppet agent
run in do_install because we also run puppet agent in some cases before
the last run. This commit adds in the wait during that agent run as well
as a check on the status endpoint in puppetdb to be sure that it is
running in the case that the port is open but puppetdb is not ready for
requests.
@demophoon demophoon force-pushed the fix/master/pe-14934-robust-puppetdb-check branch from 77dd844 to 7112971 Compare April 5, 2016 02:32
@jpartlow
Copy link
Contributor

jpartlow commented Apr 5, 2016

Ok, we have a version up with checks in both the secondary and final agent runs, with looping, and a 60 second timeout, and which respects the previous version checks while also only performing the status check on a 2016.1.x+ build.

Britt's doing a final test run of this now.

@demophoon
Copy link
Contributor Author

Install test passed on 2016.1 using ./frankenbuilder 2016.1 --install --split --vmpooler --platform ubuntu-14.04-amd64

@@ -540,6 +547,22 @@ def install_pe
install_pe_on(hosts, options)
end

def check_puppetdb_status_endpoint(host)
if version_is_less(host['pe_ver'], '2016.1.0')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could inline this conditional.

@jpartlow
Copy link
Contributor

jpartlow commented Apr 5, 2016

👍

@tvpartytonight
Copy link
Contributor

@demophoon no real problems with this PR, I'm ready to merge once your own test has been verified.

@demophoon
Copy link
Contributor Author

Tests when installing 2015.3.3 are green!!
image

@tvpartytonight
Copy link
Contributor

greengo

@tvpartytonight tvpartytonight merged commit c3bebe5 into puppetlabs:master Apr 5, 2016
jpartlow referenced this pull request in jpartlow/beaker-pe May 11, 2016
Introduced chagnes to the do_install method, but specs were failing
because of the tight coupling between expectations and counts of command
execution.

The need to initialize metadata comes from the fact that the previous
PR #3 added step() calls, which reference the TestCase metadata attr.
Since we aren't using an actual TestCase instance, this had to be
initalized separately.
jpartlow referenced this pull request in jpartlow/beaker-pe May 26, 2016
Introduced chagnes to the do_install method, but specs were failing
because of the tight coupling between expectations and counts of command
execution.

The need to initialize metadata comes from the fact that the previous
PR #3 added step() calls, which reference the TestCase metadata attr.
Since we aren't using an actual TestCase instance, this had to be
initalized separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants