From c868b03c77134d3e6b970437e515948caff7b759 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 21 Jul 2026 15:10:01 +0200 Subject: [PATCH] Revert Windows Defender step (no-op on GitHub runners) PR #267 added a step to disable Windows Defender real-time scanning on the Windows functional job, on the theory that Defender's per-process scanning was responsible for the Windows runner being several times slower than Linux. Measuring it showed no effect (79 vs 84 minutes for the same suite, within Windows runner variance). A `Get-MpComputerStatus` probe on the runner explains why: GitHub's `windows-latest` image already ships with `RealTimeProtectionEnabled: False` and `IsTamperProtected: False`, so `Set-MpPreference -DisableRealtimeMonitoring` has nothing to turn off and is a no-op. The real cost is inherent to running the process-heavy Behat suite on Windows (short-lived `wp`/`php` process spawning, PHP cold-start and NTFS file I/O per scenario), which no Defender setting can address. Remove the misleading step. Reducing what runs on Windows (the job is already `continue-on-error`) is the lever that actually helps, and can be pursued separately. --- .github/workflows/reusable-functional.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/reusable-functional.yml b/.github/workflows/reusable-functional.yml index 1e6cb5a..25da7e8 100644 --- a/.github/workflows/reusable-functional.yml +++ b/.github/workflows/reusable-functional.yml @@ -51,16 +51,6 @@ jobs: WP_CLI_TEST_OBJECT_CACHE: ${{ inputs.object_cache }} steps: - # The Behat suite spawns a large number of short-lived `wp`/`php` - # processes and writes many files per scenario. On the Windows runner, - # Defender's real-time scanning inspects each of these, which slows the - # run down by several times compared to Linux. Turning it off for the - # duration of this ephemeral job cuts the wall-clock time dramatically. - - name: Disable Windows Defender real-time scanning - if: ${{ startsWith(inputs.os, 'windows') }} - shell: pwsh - run: Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue - - name: Check out source code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: