Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tests for ValidateNotNull, ValidateNotNullOrEmpty are timing sensitive and unreliable. #5627

Copy link
Copy link
@dantraMSFT

Description

@dantraMSFT
Issue body actions

Tests in the ValidateAttributeTests.ps1 attempt to estimate the time it takes for these attributes to be applied and tests the various attributes to ensure they complete within the estimated time.

In CI, these tests can take 2-3 times longer than the estimate causing test failures.

See Context "ValidateNotNull, ValidateNotNullOrEmpty and Not-Null-Or-Empty check for Mandatory parameter" in the referenced file.

The following logic is used to calculate a baseline measurement:

Use the running time of 'MandatoryFunc -Value $byteArray' as the baseline time

$baseline = (Measure-Command { MandatoryFunc -Value $byteArray }).Milliseconds

Running time should be less than 'expected'

$expected = $baseline + 20

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    WG-Quality-Testissues in a test or in test infrastructureissues in a test or in test infrastructure

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.