Skip to content

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Jun 7, 2019

PR Summary

Fixes #901
Fixes #902

Retry Test-ModuleManifest that can sometimes throw due to a thread safety issue in PowerShell itself (I can repro in versions 5-7 and maybe later I want to look into fixing it in PS itself).
This makes PSSA more stable by retrying the operation and resolves the issue as I manually tested. I am keeping the existing method that it calls public to not break the public API although I don't think anyone is using it.
I tried to write a test for it but although I can reproduce locally, it is hard to write test that reproduces this race condition.
I also opened a PR in PowerShell itself to get it fixed in v7: PowerShell/PowerShell#9860

UPDATE: I opened PR #1258 which might be a better alternative by locking the calls of Test-ModuleManifest

PR Checklist

@bergmeister bergmeister requested a review from JamesWTruher June 7, 2019 22:06
@bergmeister bergmeister changed the title Retry Test-Module manifest calls to avoid sporadic failures to concurrency/thread safety issue in PowerShell itself Retry Test-Module manifest calls to avoid sporadic failures due to concurrency/thread safety issue in PowerShell itself Jun 7, 2019
@bergmeister
Copy link
Collaborator Author

bergmeister commented Jun 10, 2019

UPDATE: I opened PR #1258 which might be a better alternative by having a lock around the calls of Test-ModuleManifest, therefore closing this in favour of it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant