Skip to content

Windows PowerShell 5.1 tests are much slower on Server 2025 than on Server 2022 #2985

Description

@nohwnd

The PS_5_1_Windows_Server2025 leg takes longer than PS_5_1_Windows_Server2022 on every build I looked at. In build 3940 the unit test phase took 80.34s on 2022 and 135.37s on 2025, with the same 2913 tests.

It is not the image being slower. PS7 runs on the same two images in the same build:

Server 2022 Server 2025
PS7 53.35s 55.41s
PS 5.1 80.34s 135.37s

PS7 is 4% slower on 2025, Windows PowerShell 5.1 is 69% slower. A slower VM, a disk difference or Defender scanning the working folder would slow down both, so this looks like Windows PowerShell 5.1 or the .NET Framework on that image, and not the OS.

Almost every test file is slower, three carry most of it:

file 2022 2025
Help.Tests.ps1 14.95s 28.96s 1.9x
Format2.Tests.ps1 5.07s 16.81s 3.3x
Mock.Tests.ps1 13.21s 21.00s 1.6x

The gap is noisy. Over 8 recent builds 2025 was slower every single time, so the direction is real, but the size went from +0:22 to +6:48. Measure over several builds, one sample is not enough to tell whether a change helped.

This matters now because after #2984 the 5.1 legs are the slowest in the matrix and they set the wall time of a PR build, 12:07 out of 13:13.

Builds the numbers come from: 3940 (#2984), 3939, 3936, 3914, 3913, 3910, 3908, 3906.

🤖

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions