From 48636dcac28524a61fab44896fb9bf01f4fbf8b8 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 28 Oct 2026 10:42:26 -0700 Subject: [PATCH] devops: run Windows CI tests at normal I/O priority The Windows runner starts steps at I/O priority Low. The driver and the browsers inherit it, and Firefox storage flushes stall until tests time out. Reset the test steps to Normal, as microsoft/playwright#43707 does upstream. --- .github/workflows/test.yml | 12 +++++++--- scripts/windows-normal-io.ps1 | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 scripts/windows-normal-io.ps1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2d750a7cf..74bb73e1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,11 +34,15 @@ jobs: - name: Install browsers run: mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps" -f playwright/pom.xml --no-transfer-progress - name: Run tests - run: ${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24"' || '' }} mvn test --no-transfer-progress --fail-at-end ${{ runner.os == 'Windows' && '-D junit.parallel.factor=0.25' || '' }} -D org.slf4j.simpleLogger.showDateTime=true -D org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss + run: | + ${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }} + ${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24"' || '' }} mvn test --no-transfer-progress --fail-at-end ${{ runner.os == 'Windows' && '-D junit.parallel.factor=0.25' || '' }} -D org.slf4j.simpleLogger.showDateTime=true -D org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss env: BROWSER: ${{ matrix.browser }} - name: Run tracing tests w/ sources - run: ${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24"' || '' }} mvn test --no-transfer-progress --fail-at-end --projects=playwright -D test=*TestTracing* -D org.slf4j.simpleLogger.showDateTime=true -D org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss + run: | + ${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }} + ${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24"' || '' }} mvn test --no-transfer-progress --fail-at-end --projects=playwright -D test=*TestTracing* -D org.slf4j.simpleLogger.showDateTime=true -D org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss env: BROWSER: ${{ matrix.browser }} PLAYWRIGHT_JAVA_SRC: src/test/java @@ -81,7 +85,9 @@ jobs: - name: Install browsers run: mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps" -f playwright/pom.xml --no-transfer-progress - name: Run tests - run: ${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24"' || '' }} mvn test --no-transfer-progress --fail-at-end ${{ runner.os == 'Windows' && '-D junit.parallel.factor=0.25' || '' }} -D org.slf4j.simpleLogger.showDateTime=true -D org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss + run: | + ${{ runner.os == 'Windows' && '. ./scripts/windows-normal-io.ps1' || '' }} + ${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24"' || '' }} mvn test --no-transfer-progress --fail-at-end ${{ runner.os == 'Windows' && '-D junit.parallel.factor=0.25' || '' }} -D org.slf4j.simpleLogger.showDateTime=true -D org.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss env: BROWSER: chromium BROWSER_CHANNEL: ${{ matrix.browser-channel }} diff --git a/scripts/windows-normal-io.ps1 b/scripts/windows-normal-io.ps1 new file mode 100644 index 000000000..f1308b638 --- /dev/null +++ b/scripts/windows-normal-io.ps1 @@ -0,0 +1,44 @@ +# Dot-source at the start of a Windows test step: the self-hosted runner starts steps at +# I/O priority Low, which the driver and the browsers inherit, and Firefox storage flushes +# then stall until tests time out. See https://github.com/microsoft/playwright/issues/43704. + +$ErrorActionPreference = 'Stop' + +Add-Type -TypeDefinition @' +using System; +using System.Runtime.InteropServices; + +public static class TestProcessIOPriority { + [DllImport("ntdll.dll")] + public static extern int NtSetInformationProcess( + IntPtr process, int informationClass, ref int information, int size); + + [DllImport("ntdll.dll")] + public static extern int NtQueryInformationProcess( + IntPtr process, int informationClass, out int information, int size, out int length); +} +'@ + +$priority = 0 +$length = 0 +$status = [TestProcessIOPriority]::NtQueryInformationProcess( + [IntPtr](-1), 33, [ref]$priority, 4, [ref]$length) +if ($status -ne 0) { + throw ('Reading I/O priority failed: NTSTATUS 0x{0:X8}' -f $status) +} +$inheritedPriority = $priority +$priority = 2 +$status = [TestProcessIOPriority]::NtSetInformationProcess( + [IntPtr](-1), 33, [ref]$priority, 4) +if ($status -ne 0) { + throw ('Setting normal I/O priority failed: NTSTATUS 0x{0:X8}' -f $status) +} +$status = [TestProcessIOPriority]::NtQueryInformationProcess( + [IntPtr](-1), 33, [ref]$priority, 4, [ref]$length) +if ($status -ne 0) { + throw ('Reading I/O priority failed: NTSTATUS 0x{0:X8}' -f $status) +} +if ($priority -ne 2) { + throw "Expected normal I/O priority (2), got $priority" +} +Write-Host "Test launcher I/O priority: $inheritedPriority -> $priority (Normal)"