-
Notifications
You must be signed in to change notification settings - Fork 106
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
PDK::Util::Bundler.ensure_bundle! causes parallel execution of pdk new test to fail #1074
Comments
Thanks for the great bug report @hsnodgrass! Unfortunately the ruby pdk internals were not designed to handle being executed in parallel. As you have found, there are a significant number of file system and gem operations that happen that expect to have exclusive access to files and folders during the operation. There isn't anything we can do at this time to help with this code path. The good news is that we already have work in flight that address this kind of work with a new approach. We'll be communicating this approach in the coming weeks. |
Hi @hsnodgrass I'd love to know if the new Puppet Content Templates can address this issue for you |
This issue has been marked stale because it is open with no recent activity. The PDK Team is actively prioritizing existing bugs and new features, if this issue is still important to you please comment and we will add this to our backlog to complete. |
This issue was closed because it is open with no recent activity. The PDK Team is actively prioritizing existing bugs and new features, if this issue is still important to you please comment and we will add this to our backlog to complete. |
Reopened. Should not have been closed. |
Unfortunately this is a known issue we have with PowerShell 7 and not something that we can fix at the moment, as said by James above:
|
Describe the bug
When running
pdk new test --unit
in PowerShell 7 via theForEach-Object -Parallel
cmdlet, the functionPDK::Util::Bundler.ensure_bundle!
causes failures due to the function moving theGemfile.lock
while the other executing parallel commands are checking forGemfile.lock
and attempting to move it.To Reproduce
cd
into a module directoryGet-ChildItem -Path .\manifests\path\to\your\manifests\dir | ForEach-Object -Parallel { pdk new test --unit ('module::path::to::your::manifests::dir::' + $_.name -replace '.pp','') } -ThrottleLimit 20
PDK::Util::Bundler.ensure_bundle!
is the culprit by commenting out the following line inC:\Program Files\Puppet Labs\DevelopmentKit\private\ruby\<version>\lib\ruby\gems\<version>\gems\pdk-2.1.0\lib\pdk\cli\new
:# PDK::Util::Bundler.ensure_bundle!(puppet_env[:gemset])
. Line 36 for me, may be different for you.Expected behavior
Running
pdk new test --unit
in parallel should not fail. This would require either a command line flag to skipensure_bundle!
or alternate logic inensure_bundle!
that does not require movingGemfile.lock
.Additional context
2.1.0
The text was updated successfully, but these errors were encountered: