Skip to content

Fix/Skip/Remove Flaky Tests #21274

@jborean93

Description

@jborean93

Prerequisites

Steps to reproduce

When submitting a PR there are some tests which are currently only sometimes passing and can potentially fail. This is incredibly frustrating for people submitting PRs because it looks like your PR is failing and could give a false impression that the PR is breaking something when it isn't or is not ready for review. It is also only possible to close and reopen your PR which runs the whole test suite again which could then encounter another flaky test and just wastes time to run.

Either these tests should be fixed up so they can run consistently without failure or skipped/removed because a sometimes failing test is worse than no test at all.

Three tests that I've consistently come across as flaky are:

Value cannot be null. (Parameter 'replyResult')

at <ScriptBlock>, /Users/runner/work/1/s/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1: line 274
274:             $result = Test-Connection $testAddress -MtuSize
Process must exit before requested information can be determined.

at <ScriptBlock>, /Users/runner/work/1/s/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1: line 21
21:             Set-Clipboard -Value $guid
Expected $true, but got $false.

at <ScriptBlock>, D:\a\1\s\test\powershell\engine\Basic\GroupPolicySettings.Tests.ps1: line 94
94:                         Should -BeTrue

Expected behavior

Tests pass consistently

Actual behavior

Some tests fail

Error details

No response

Environment data

CI

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions