A number of pxp-agent acceptance tests rely on having Puppet spawn sleep using an exec resource; to intentionally have a pxp transaction kept in a running state. When the test is ready for the transaction to continue; we grep the process list to determine the sleep pid then send a kill command.
This works but we need to maintain beaker commands for finding and killing sleep that will work for every platform we support (and are a risk for adding newly supported platforms). It also burdens us with needing to write tests that are very sensitive on timing (e.g. it might take multiple seconds for Puppet to invoke and the sleep process to appear)
One possibly better approach from a different repo's tests is to have Puppet code that will stall while waiting for a condition (a file to exist)
The test case signals the Puppet run to complete by creating the unblocking_file file on the SUT.