Skip to content

Revert Windows Defender step (no-op on GitHub runners) - #268

Merged
schlessera merged 1 commit into
mainfrom
revert-defender-windows-noop
Jul 21, 2026
Merged

Revert Windows Defender step (no-op on GitHub runners)#268
schlessera merged 1 commit into
mainfrom
revert-defender-windows-noop

Conversation

@schlessera

@schlessera schlessera commented Jul 21, 2026

Copy link
Copy Markdown
Member

Reverts the Defender step added in #267.

Why

#267 disabled Windows Defender real-time scanning on the Windows functional job, on the theory that Defender's per-process scanning was making the Windows runner several times slower than Linux. Measuring it showed no effect: ~79 min vs ~84 min for the same suite, within Windows runner variance.

A Get-MpComputerStatus probe on the runner explains why:

RealTimeProtectionEnabled : False
IsTamperProtected         : False
AntivirusEnabled          : True

GitHub's windows-latest image already ships with real-time protection off, so Set-MpPreference -DisableRealtimeMonitoring (and an Add-MpPreference -ExclusionPath fallback) have nothing to turn off. The step is a no-op and misleads future maintainers into thinking Windows Defender is handled.

What's actually slow

Effectively all of the Windows job time is the single Run Behat step (~80 min; setup is ~2 min), and it's uniform per-scenario overhead rather than one slow test. That's 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. No Defender setting addresses it.

The job is already continue-on-error (informational, never blocks a PR). The lever that would actually cut wall-clock is running less on Windows (a tagged smoke subset) or sharding it, which can be pursued separately.

Summary by CodeRabbit

  • Chores
    • Updated Windows functional testing workflows to no longer disable Microsoft Defender real-time scanning during test runs.
    • All other testing steps remain unchanged.

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.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f6a77b50-80ac-4217-a1be-436203d2cdf6

📥 Commits

Reviewing files that changed from the base of the PR and between 08748c8 and c868b03.

📒 Files selected for processing (1)
  • .github/workflows/reusable-functional.yml

📝 Walkthrough

Walkthrough

The reusable functional testing workflow removes the Windows-only step that disabled Microsoft Defender real-time scanning. Checkout, setup, database, Behat, and optional coverage steps remain unchanged.

Changes

Functional testing workflow

Layer / File(s) Summary
Remove Windows Defender step
.github/workflows/reusable-functional.yml
Removes the Windows-specific Defender real-time scanning step, allowing the workflow to proceed directly to source checkout.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • wp-cli/.github#267: Added the Windows-specific Defender step removed by this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-defender-windows-noop

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added enhancement New feature or request scope:testing labels Jul 21, 2026
@swissspidy

Copy link
Copy Markdown
Member

Bummer!

@schlessera
schlessera marked this pull request as ready for review July 21, 2026 14:34
@schlessera
schlessera requested a review from a team as a code owner July 21, 2026 14:34
@schlessera
schlessera merged commit 846c719 into main Jul 21, 2026
16 checks passed
@schlessera
schlessera deleted the revert-defender-windows-noop branch July 21, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request scope:testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants