Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
44 changes: 44 additions & 0 deletions scripts/windows-normal-io.ps1
Original file line number Diff line number Diff line change
@@ -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)"
Loading