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

TestRegistry causes test failures when running Pester test fixtures in parallel #1216

Closed
splatteredbits opened this issue Jan 17, 2019 · 1 comment

Comments

@splatteredbits
Copy link
Contributor

1. General summary of the issue

We have a very large, long-running Pester test suite. We've optimized it by running it in several background processes that run in parallel. With Pester 4.5, we're now getting intermittent test failures associated with the new TestRegistry drive.

Describing MSBuild.when building multiple real projects as a developer
Cannot find drive. A drive with the name 'TestRegistry' does not exist.
+ CategoryInfo          : ObjectNotFound: (TestRegistry:String) [Get-PSDrive], DriveNotFoundException
+ FullyQualifiedErrorId : GetLocationNoMatchingDrive,Microsoft.PowerShell.Commands.GetPSDriveCommand
+ PSComputerName        : localhost
 
    [-] Error occurred in Describe block 530ms
      PSArgumentException: Cannot process argument because the value of argument "path" is not valid. Change the value of the "path" argument and run the operation again.
      at Clear-TestRegistry, C:\projects\whiskey\PSModules\Pester\4.5.0\Functions\TestRegistry.ps1: line 77
      at DescribeImpl, C:\projects\whiskey\PSModules\Pester\4.5.0\Functions\Describe.ps1: line 194

2. Describe Your Environment

Pester version     : 4.5.0 C:\Build\Whiskey\PSModules\Pester\4.5.0\Pester.psm1
PowerShell version : 5.1.17134.407
OS version         : Microsoft Windows NT 10.0.17134.0

3. Expected Behavior

I expect that when Pester is tearing things down, it never causes a test failure.\

4.Current Behavior

When Pester fails to tear down the test registry, it can cause failures across tests.

5. Possible Solution

We've never had a problem with the TestDrive on the file system. Fortunately, we use $TestDrive instead of TestDrive. I'm not sure how your code handles tearing down the TestDrive, but we've never seen a problem with that.

6. Context

We now have to stay pinned to 4.4.x. It sucks to have to re-run a 25 to 30 minute build a few times because your testing tool is failing the build, instead of your tests.

@nohwnd
Copy link
Member

nohwnd commented Jan 18, 2019

@splatteredbits Thanks for reporting, there was a similar problem that I was solving in #1181 and there was also a weird bug when the path existed, the drive existed, but get-psdrive did not see it (or something like that). I'll try running few more test runs in parallel to see if I can trigger this issue.

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

No branches or pull requests

2 participants