(PUP-3277) Check if puppetdb has emptied queue before reports test
The PE version of acceptance/tests/reports/submission.rb queries
puppetdb before and after an agent run to check that a new report has
been stored. Occasionally, depending on load issues in our testing
environment, Beaker would request the current report time before
puppetdb had had a chance to finish processing, and the test would fail
because we would see the previous timestamp. This patch borrows a
helper from puppetdb which checks that the worker queue is empty before
querying for the latest report.