René's URL Explorer Experiment


Title: Make xUnit test run sequentially to rule out race conditions around 'powershell.config.json' by daxian-dbw · Pull Request #8945 · PowerShell/PowerShell · GitHub

Open Graph Title: Make xUnit test run sequentially to rule out race conditions around 'powershell.config.json' by daxian-dbw · Pull Request #8945 · PowerShell/PowerShell

X Title: Make xUnit test run sequentially to rule out race conditions around 'powershell.config.json' by daxian-dbw · Pull Request #8945 · PowerShell/PowerShell

Description: PR Summary Make xUnit test truly run sequentially to rule out race conditions around powershell.config.json. Fix #8784 #8715 PR Context We keep getting xUnit test failures due to the race condition around manipulating powershell.config.json file, even though we have been trying to run xUnit tests sequentially by having dotnet test -p:ParallelizeTestCollections=false. It turns out -p:ParallelizeTestCollections=false doesn't work, and we have to use xunit.runner.json to disable parallel running. Failure example: https://powershell.visualstudio.com/PowerShell/_build/results?buildId=13830 From the exception below, we can see the all-user scope config file was there when we check for file existence in ReadValueFromFile, but was deleted when we came to creating a FileStream out of it. This is because the all-user scope config file as created and deleted as part of the PSConfiguration tests. This is an evidence that tests are still running in parallel with dotnet test -p:ParallelizeTestCollections=false. [xUnit.net 00:00:03.20] PSTests.Sequential.RunspaceTests.TestRunspaceWithPowerShellAndInitialSessionState [FAIL] Failed PSTests.Sequential.RunspaceTests.TestRunspaceWithPowerShellAndInitialSessionState Error Message: System.IO.FileNotFoundException : Could not find file 'C:\Users\VssAdministrator\Documents\PowerShell\powershell.config.json'. Stack Trace: at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.Management.Automation.Configuration.PowerShellConfig.WaitForFile(String fullPath, FileMode mode, FileAccess access, FileShare share) in D:\a\1\s\src\System.Management.Automation\engine\PSConfiguration.cs:line 426 at System.Management.Automation.Configuration.PowerShellConfig.ReadValueFromFile[T](ConfigScope scope, String key, T defaultValue, Func`4 readImpl) in D:\a\1\s\src\System.Management.Automation\engine\PSConfiguration.cs:line 397 at System.Management.Automation.Utils.GetPolicySettingFromConfigFile[T](ConfigScope[] preferenceOrder) in D:\a\1\s\src\System.Management.Automation\engine\Utils.cs:line 523 at System.Management.Automation.Utils.GetPolicySetting[T](ConfigScope[] preferenceOrder) in D:\a\1\s\src\System.Management.Automation\engine\Utils.cs:line 509 at Microsoft.PowerShell.Commands.ModuleCmdletBase.GetModuleLoggingInformation(IEnumerable`1& moduleNames) in D:\a\1\s\src\System.Management.Automation\engine\Modules\ModuleCmdletBase.cs:line 4507 at System.Management.Automation.PSSnapInReader.ReadEnginePSSnapIns() in D:\a\1\s\src\System.Management.Automation\singleshell\config\MshSnapinInfo.cs:line 1068 at System.Management.Automation.Runspaces.InitialSessionState.CreateDefault() in D:\a\1\s\src\System.Management.Automation\engine\InitialSessionState.cs:line 1526 at PSTests.Sequential.RunspaceTests.TestRunspaceWithPowerShellAndInitialSessionState() in D:\a\1\s\test\xUnit\csharp\test_Runspace.cs:line 72 Results File: D:\a\1\s\ParallelXUnitTestResults.xml PR Checklist PR has a meaningful title Use the present tense and imperative mood when describing your changes Summarized changes Change is not breaking Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header This PR is ready to merge and is not Work in Progress. If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready. User-facing changes Not Applicable OR Documentation needed Issue filed: Testing - New and feature N/A or can only be tested interactively OR Make sure you've added a new test if existing tests do not effectively test the code changed Add [feature] to your commit messages if the change is significant or affects feature tests

Open Graph Description: PR Summary Make xUnit test truly run sequentially to rule out race conditions around powershell.config.json. Fix #8784 #8715 PR Context We keep getting xUnit test failures due to the race condition...

X Description: PR Summary Make xUnit test truly run sequentially to rule out race conditions around powershell.config.json. Fix #8784 #8715 PR Context We keep getting xUnit test failures due to the race condition...

Opengraph URL: https://github.com/PowerShell/PowerShell/pull/8945

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:796e5054-accb-042b-054c-57166553fd90
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC6A6:241052:1C6B474:2640512:6A59867B
html-safe-nonce6c4472ed5873b5225f0a91afa47755fce902b175d7a73a16b21a53e7fdaeb083
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkE2OjI0MTA1MjoxQzZCNDc0OjI2NDA1MTI6NkE1OTg2N0IiLCJ2aXNpdG9yX2lkIjoiOTE5MTM5Mjc2MDEyNTAzMjA1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc7e5c52c991ad741a9cdf416a414e8116a1d664f4956ce6fa9cf7a8477e43a7f
hovercard-subject-tagpull_request:255158478
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/PowerShell/PowerShell/pull/8945/files
twitter:imagehttps://avatars.githubusercontent.com/u/127450?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/127450?s=400&v=4
og:image:altPR Summary Make xUnit test truly run sequentially to rule out race conditions around powershell.config.json. Fix #8784 #8715 PR Context We keep getting xUnit test failures due to the race condition...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonea540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release624bb50a7497aa346bef8cc3743af408a9ea10ca
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/pull/8945/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F8945%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F8945%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/pull/8945/files
Reloadhttps://github.com/PowerShell/PowerShell/pull/8945/files
Reloadhttps://github.com/PowerShell/PowerShell/pull/8945/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/8945/files
PowerShell https://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Notifications https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Fork 8.4k https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Star 54.4k https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Code https://github.com/PowerShell/PowerShell
Issues 1.2k https://github.com/PowerShell/PowerShell/issues
Pull requests 290 https://github.com/PowerShell/PowerShell/pulls
Discussions https://github.com/PowerShell/PowerShell/discussions
Actions https://github.com/PowerShell/PowerShell/actions
Projects https://github.com/PowerShell/PowerShell/projects
Security and quality 3 https://github.com/PowerShell/PowerShell/security
Insights https://github.com/PowerShell/PowerShell/pulse
Code https://github.com/PowerShell/PowerShell
Issues https://github.com/PowerShell/PowerShell/issues
Pull requests https://github.com/PowerShell/PowerShell/pulls
Discussions https://github.com/PowerShell/PowerShell/discussions
Actions https://github.com/PowerShell/PowerShell/actions
Projects https://github.com/PowerShell/PowerShell/projects
Security and quality https://github.com/PowerShell/PowerShell/security
Insights https://github.com/PowerShell/PowerShell/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FPowerShell%2FPowerShell%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FPowerShell%2FPowerShell%2Fissues%2Fnew%2Fchoose
daxian-dbwhttps://github.com/daxian-dbw
PowerShell:masterhttps://github.com/PowerShell/PowerShell/tree/master
daxian-dbw:xunithttps://github.com/daxian-dbw/PowerShell/tree/xunit
Conversation 18 https://github.com/PowerShell/PowerShell/pull/8945
Commits 4 https://github.com/PowerShell/PowerShell/pull/8945/commits
Checks 0 https://github.com/PowerShell/PowerShell/pull/8945/checks
Files changed https://github.com/PowerShell/PowerShell/pull/8945/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/8945/files
Make xUnit test run sequentially to rule out race conditions around 'powershell.config.json' https://github.com/PowerShell/PowerShell/pull/8945/files#top
Show all changes 4 commits https://github.com/PowerShell/PowerShell/pull/8945/files
d3715b0 Make xUnit test run sequentially to rule out race conditions around '… daxian-dbw Feb 21, 2019 https://github.com/PowerShell/PowerShell/pull/8945/commits/d3715b03afc7b1af3908c5a551c9254c7751196b
abde6d2 Address Aditya's comment daxian-dbw Feb 21, 2019 https://github.com/PowerShell/PowerShell/pull/8945/commits/abde6d2d4904f39d8c44b17232d7dacd78662c50
82f44a3 Fix the parameter name in ci.psm1 daxian-dbw Feb 21, 2019 https://github.com/PowerShell/PowerShell/pull/8945/commits/82f44a38b52c91aa193ac9e46f7f4febc03e81f9
7a2833f Update windows.yml to use the new unit test result file name daxian-dbw Feb 21, 2019 https://github.com/PowerShell/PowerShell/pull/8945/commits/7a2833f801d7b26955bffd0e0a5f766e1318b328
Clear filters https://github.com/PowerShell/PowerShell/pull/8945/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/8945/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/8945/files
windows.yml https://github.com/PowerShell/PowerShell/pull/8945/files#diff-0c75d2c6f3ceda412aedd44f1141924e95597eb522d36c1018cba218c1e7a166
build.psm1 https://github.com/PowerShell/PowerShell/pull/8945/files#diff-1eb6991ceacad71a638a32bcf0a4ec906c7ec150f5086732ab6d7702a624914a
xUnit.tests.csproj https://github.com/PowerShell/PowerShell/pull/8945/files#diff-180c834756f5e695ec82931cc3a57373d18cf17f87594f4597668a7133834709
xunit.runner.json https://github.com/PowerShell/PowerShell/pull/8945/files#diff-09ceb8b7d2b55fdc45925a1e20d2bb8900b0668e29822cc1976e6680b17e9411
ci.psm1 https://github.com/PowerShell/PowerShell/pull/8945/files#diff-d6a0a16023ad444077336e0a3b589b3ccff075c8831329252b65091a77471400
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L61
.vsts-ci/windows.ymlhttps://github.com/PowerShell/PowerShell/pull/8945/files#diff-0c75d2c6f3ceda412aedd44f1141924e95597eb522d36c1018cba218c1e7a166
View file https://github.com/daxian-dbw/PowerShell/blob/7a2833f801d7b26955bffd0e0a5f766e1318b328/.vsts-ci/windows.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/8945/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-0c75d2c6f3ceda412aedd44f1141924e95597eb522d36c1018cba218c1e7a166
TravisEz13https://github.com/TravisEz13
Feb 21, 2019https://github.com/PowerShell/PowerShell/pull/8945/files#r259159872
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/8945/files
TravisEz13https://github.com/TravisEz13
Feb 21, 2019https://github.com/PowerShell/PowerShell/pull/8945/files#r259160343
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/8945/files
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L63
build.psm1https://github.com/PowerShell/PowerShell/pull/8945/files#diff-1eb6991ceacad71a638a32bcf0a4ec906c7ec150f5086732ab6d7702a624914a
View file https://github.com/daxian-dbw/PowerShell/blob/7a2833f801d7b26955bffd0e0a5f766e1318b328/build.psm1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/8945/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-1eb6991ceacad71a638a32bcf0a4ec906c7ec150f5086732ab6d7702a624914a
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/8945/files
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-1eb6991ceacad71a638a32bcf0a4ec906c7ec150f5086732ab6d7702a624914a
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-1eb6991ceacad71a638a32bcf0a4ec906c7ec150f5086732ab6d7702a624914a
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-1eb6991ceacad71a638a32bcf0a4ec906c7ec150f5086732ab6d7702a624914a
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L62
test/xUnit/xUnit.tests.csprojhttps://github.com/PowerShell/PowerShell/pull/8945/files#diff-180c834756f5e695ec82931cc3a57373d18cf17f87594f4597668a7133834709
View file https://github.com/daxian-dbw/PowerShell/blob/7a2833f801d7b26955bffd0e0a5f766e1318b328/test/xUnit/xUnit.tests.csproj
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/8945/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-180c834756f5e695ec82931cc3a57373d18cf17f87594f4597668a7133834709
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L7
test/xUnit/xunit.runner.jsonhttps://github.com/PowerShell/PowerShell/pull/8945/files#diff-09ceb8b7d2b55fdc45925a1e20d2bb8900b0668e29822cc1976e6680b17e9411
View file https://github.com/daxian-dbw/PowerShell/blob/7a2833f801d7b26955bffd0e0a5f766e1318b328/test/xUnit/xunit.runner.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/8945/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L64
tools/ci.psm1https://github.com/PowerShell/PowerShell/pull/8945/files#diff-d6a0a16023ad444077336e0a3b589b3ccff075c8831329252b65091a77471400
View file https://github.com/daxian-dbw/PowerShell/blob/7a2833f801d7b26955bffd0e0a5f766e1318b328/tools/ci.psm1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/8945/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-d6a0a16023ad444077336e0a3b589b3ccff075c8831329252b65091a77471400
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-d6a0a16023ad444077336e0a3b589b3ccff075c8831329252b65091a77471400
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-d6a0a16023ad444077336e0a3b589b3ccff075c8831329252b65091a77471400
https://github.com/PowerShell/PowerShell/pull/8945/files#diff-d6a0a16023ad444077336e0a3b589b3ccff075c8831329252b65091a77471400
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.