Skip to content

Add retry to Enter-PSHostProcess test - #11360

Merged
Aditya Patwardhan (adityapatwardhan) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:enterpshostprocess-test
Dec 20, 2019
Merged

Aditya Patwardhan (adityapatwardhan) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:enterpshostprocess-test

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Dec 16, 2019 •

Copy link
Copy Markdown
Member

PR Summary

Been seeing this test fail in CI on occasion. Have it retry 5 times and also write out a verbose message if the runspace state is not valid to see why it fails.

PR Checklist

$ps.AddScript('$pid').Invoke() | Should -Be $pwshId
$ps.AddScript('$pid')

[int]$retry = 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use Wait-UntilTrue from HelpersCommon.psm1?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not, maybe add a retry function on HelpersCommon.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worked out a Invoke-ScriptBlockWithRetry function, but it doesn't save much and makes the code harder to understand since I need to pass two types of information back.

@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Dec 18, 2019

@TylerLeonhardt TylerLeonhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit 27e1664 into PowerShell:master Dec 20, 2019
@daxian-dbw Dongbo Wang (daxian-dbw) added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Jan 15, 2020
@ghost

Copy link
Copy Markdown

🎉v7.0.0-rc.2 has been released which incorporates this pull request.:tada:

Handy links:

@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the enterpshostprocess-test branch June 6, 2020 02:30
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants