From 0ad6537cb7855ded8762189fd7ba69762cc122dd Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 19:23:21 +0000 Subject: [PATCH 1/7] probe --- .github/workflows/probe.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/probe.yml diff --git a/.github/workflows/probe.yml b/.github/workflows/probe.yml new file mode 100644 index 00000000..9024dcbb --- /dev/null +++ b/.github/workflows/probe.yml @@ -0,0 +1,17 @@ +name: probe +on: + pull_request: + branches: ["*"] +jobs: + probe: + runs-on: windows-latest + steps: + - shell: pwsh + run: | + Get-Service | Where-Object { $_.Name -match 'postgres|mysql' } | Format-Table Name,Status,StartType + Get-ChildItem 'C:\Program Files\PostgreSQL','C:\Program Files\MySQL' -ErrorAction SilentlyContinue | Select FullName + Get-ChildItem 'C:\Program Files\MySQL\*\bin\mysqld.exe' -ErrorAction SilentlyContinue + $env:PGROOT; $env:PGBIN; $env:PGPASSWORD + Get-Content 'C:\Program Files\PostgreSQL\*\pg_hba.conf' -ErrorAction SilentlyContinue | Select-String -NotMatch '^\s*#|^\s*$' + Get-ChildItem C:\ProgramData\MySQL -ErrorAction SilentlyContinue + nuget help | Select -First 1; Get-Command msbuild -ErrorAction SilentlyContinue From 676b69166c08fb861d456014b66a03506c0ca83e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 19:24:03 +0000 Subject: [PATCH 2/7] Speed up legacy e2e: use preinstalled Postgres/MySQL, start in background --- .github/workflows/legacy-tests.yml | 113 ++++++++++++----------------- .github/workflows/probe.yml | 17 ----- 2 files changed, 48 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/probe.yml diff --git a/.github/workflows/legacy-tests.yml b/.github/workflows/legacy-tests.yml index 6d437f06..0583682d 100644 --- a/.github/workflows/legacy-tests.yml +++ b/.github/workflows/legacy-tests.yml @@ -52,74 +52,57 @@ jobs: - name: Setup NuGet uses: NuGet/setup-nuget@v3.1.0 - - name: Install Chocolatey - shell: powershell + # PostgreSQL 17 and MySQL 8.0 come preinstalled on the Windows runner image - using them is much faster than + # downloading and installing them (setup-postgres ~3.5 min, choco mysql ~2 min). + # Both databases are started in the background while the test projects are restored and built. + - name: Start databases in the background + shell: pwsh run: | - Set-ExecutionPolicy Bypass -Scope Process -Force - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 - iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + $pgBin = "$env:PGROOT\bin" + $mysqlBin = 'C:\Program Files\MySQL\MySQL Server 8.0\bin' + Set-Content -Path "$env:RUNNER_TEMP\start-dbs.ps1" -Value @" + `$ErrorActionPreference = 'Stop' + Set-Service postgresql-x64-17 -StartupType Manual + Start-Service postgresql-x64-17 + `$env:PGPASSWORD = 'root' + & '$pgBin\psql.exe' -U postgres -c "ALTER USER postgres PASSWORD '$env:POSTGRES_PASSWORD'" + & '$pgBin\psql.exe' -U postgres -c "CREATE DATABASE $env:TESTS_DB" + `$env:PGPASSWORD = '$env:POSTGRES_PASSWORD' + & '$pgBin\psql.exe' -U postgres -d $env:TESTS_DB -f 'examples/config/postgresql/types/schema.sql' -f 'examples/config/postgresql/authors/schema.sql' - - uses: ikalnytskyi/action-setup-postgres@v8 - with: - username: ${{ env.POSTGRES_USER }} - password: ${{ env.POSTGRES_PASSWORD }} - database: ${{ env.TESTS_DB }} - postgres-version: "16" - id: postgres - - - name: Init PostgresSQL Schema - shell: powershell - run: psql -U $Env:POSTGRES_USER -f 'examples/config/postgresql/types/schema.sql' -f 'examples/config/postgresql/authors/schema.sql' - env: - PGSERVICE: ${{ steps.postgres.outputs.service-name }} - PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} - - - uses: nick-fields/retry@v4 - name: Install MySQL and restore test projects in parallel (with retry) - with: - retry_on: error - max_attempts: 2 - timeout_minutes: 7 - shell: pwsh - command: | - $mysqlJob = Start-Job -ScriptBlock { - choco install mysql --no-progress -y --params "/serviceName:MySQL" - return $LASTEXITCODE - } - - $restoreJob = Start-Job -ScriptBlock { - Get-ChildItem -Path examples -Recurse -Filter *.csproj | - Where-Object { $_.FullName -like '*Legacy*' } | - ForEach-Object { nuget restore $_.FullName } - nuget restore ./end2end/EndToEndCommon/EndToEndCommon.csproj - nuget restore ./end2end/EndToEndTestsLegacy/EndToEndTestsLegacy.csproj - msbuild.exe ./end2end/EndToEndTestsLegacy/EndToEndTestsLegacy.csproj -p:Configuration=Release -p:FrameworkVersion=v4.7.2 - return $LASTEXITCODE - } - - Wait-Job -Job $mysqlJob, $restoreJob - - $mysqlOutput = Receive-Job -Job $mysqlJob - $mysqlExitCode = @($mysqlOutput)[-1] - if ($mysqlExitCode -ne 0) { - Write-Error "MySQL install failed with exit code: $mysqlExitCode`n$mysqlOutput" - return $mysqlExitCode - } - - $restoreOutput = Receive-Job -Job $restoreJob - $restoreExitCode = @($restoreOutput)[-1] - if ($restoreExitCode -ne 0) { - Write-Error "Restore/build failed with exit code: $restoreExitCode`n$restoreOutput" - return $restoreExitCode - } - - - name: Init MySQL Schema - shell: powershell + & '$mysqlBin\mysqld.exe' --initialize-insecure --console --datadir=C:\mysql-data + Start-Process -FilePath '$mysqlBin\mysqld.exe' -ArgumentList '--console','--datadir=C:\mysql-data','--local-infile=1' -WindowStyle Hidden + for (`$i = 0; `$i -lt 60; `$i++) { & '$mysqlBin\mysqladmin.exe' -u root ping 2>`$null; if (`$LASTEXITCODE -eq 0) { break }; Start-Sleep -Seconds 1 } + & '$mysqlBin\mysql.exe' -u root -e "SET GLOBAL local_infile=1; CREATE DATABASE $env:TESTS_DB;" + & '$mysqlBin\mysql.exe' -u root $env:TESTS_DB --execute="source examples/config/mysql/types/schema.sql; source examples/config/mysql/authors/schema.sql;" + "@ + Start-Process -FilePath pwsh -ArgumentList '-NoProfile','-File',"$env:RUNNER_TEMP\start-dbs.ps1" ` + -RedirectStandardOutput "$env:RUNNER_TEMP\dbs.log" -RedirectStandardError "$env:RUNNER_TEMP\dbs.err.log" -WindowStyle Hidden + + - name: Restore and build test projects + shell: pwsh + run: | + Get-ChildItem -Path examples -Recurse -Filter *.csproj | + Where-Object { $_.FullName -like '*Legacy*' } | + ForEach-Object { nuget restore $_.FullName } + nuget restore ./end2end/EndToEndCommon/EndToEndCommon.csproj + nuget restore ./end2end/EndToEndTestsLegacy/EndToEndTestsLegacy.csproj + msbuild.exe ./end2end/EndToEndTestsLegacy/EndToEndTestsLegacy.csproj -p:Configuration=Release -p:FrameworkVersion=v4.7.2 -m + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + - name: Wait for databases + shell: pwsh run: | - $env:Path += ";C:\Program Files\MySQL\MySQL Server 8.0\bin" - [Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine") - mysql -u root -e "SET GLOBAL local_infile=1; CREATE DATABASE $Env:TESTS_DB;" - mysql -u root $Env:TESTS_DB --execute="source examples/config/mysql/types/schema.sql; source examples/config/mysql/authors/schema.sql;" + $mysqlBin = 'C:\Program Files\MySQL\MySQL Server 8.0\bin' + $env:PGPASSWORD = $env:POSTGRES_PASSWORD + for ($i = 0; $i -lt 120; $i++) { + $pg = & "$env:PGROOT\bin\psql.exe" -U postgres -d $env:TESTS_DB -tAc "select to_regclass('public.authors') is not null" 2>$null + $my = & "$mysqlBin\mysql.exe" -u root -N -e "select count(*) from information_schema.tables where table_schema='$env:TESTS_DB'" 2>$null + if ($pg -eq 't' -and [int]$my -gt 0) { Write-Host "databases ready"; exit 0 } + Start-Sleep -Seconds 2 + } + Get-Content "$env:RUNNER_TEMP\dbs.log", "$env:RUNNER_TEMP\dbs.err.log" -ErrorAction SilentlyContinue + exit 1 - name: Run Tests shell: powershell diff --git a/.github/workflows/probe.yml b/.github/workflows/probe.yml deleted file mode 100644 index 9024dcbb..00000000 --- a/.github/workflows/probe.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: probe -on: - pull_request: - branches: ["*"] -jobs: - probe: - runs-on: windows-latest - steps: - - shell: pwsh - run: | - Get-Service | Where-Object { $_.Name -match 'postgres|mysql' } | Format-Table Name,Status,StartType - Get-ChildItem 'C:\Program Files\PostgreSQL','C:\Program Files\MySQL' -ErrorAction SilentlyContinue | Select FullName - Get-ChildItem 'C:\Program Files\MySQL\*\bin\mysqld.exe' -ErrorAction SilentlyContinue - $env:PGROOT; $env:PGBIN; $env:PGPASSWORD - Get-Content 'C:\Program Files\PostgreSQL\*\pg_hba.conf' -ErrorAction SilentlyContinue | Select-String -NotMatch '^\s*#|^\s*$' - Get-ChildItem C:\ProgramData\MySQL -ErrorAction SilentlyContinue - nuget help | Select -First 1; Get-Command msbuild -ErrorAction SilentlyContinue From 0b7479b2c4156434551fca432222dba809d6d35f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 19:38:55 +0000 Subject: [PATCH 3/7] Legacy e2e: move DB startup into scripts, fix postgres password ordering, relax durability Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AuXKqNkqwnaoKv3sewFkRc --- .github/scripts/start-mysql.ps1 | 25 +++++++++++++++++ .github/scripts/start-postgres.ps1 | 19 +++++++++++++ .github/workflows/legacy-tests.yml | 43 ++++++++++-------------------- 3 files changed, 58 insertions(+), 29 deletions(-) create mode 100644 .github/scripts/start-mysql.ps1 create mode 100644 .github/scripts/start-postgres.ps1 diff --git a/.github/scripts/start-mysql.ps1 b/.github/scripts/start-mysql.ps1 new file mode 100644 index 00000000..d16954c3 --- /dev/null +++ b/.github/scripts/start-mysql.ps1 @@ -0,0 +1,25 @@ +# Initializes and starts the MySQL server preinstalled on the Windows runner image and loads the test schemas. +$ErrorActionPreference = 'Stop' +$bin = 'C:\Program Files\MySQL\MySQL Server 8.0\bin' +$dataDir = 'C:\mysql-data' +$fast = '--skip-log-bin', '--innodb-flush-log-at-trx-commit=0', '--innodb-doublewrite=0' + +& "$bin\mysqld.exe" --initialize-insecure --console "--datadir=$dataDir" @fast +if ($LASTEXITCODE -ne 0) { throw 'mysqld --initialize-insecure failed' } + +Start-Process -FilePath "$bin\mysqld.exe" -WindowStyle Hidden ` + -ArgumentList '--console', "--datadir=$dataDir", '--local-infile=1', @fast ` + -RedirectStandardOutput "$env:RUNNER_TEMP\mysqld.log" -RedirectStandardError "$env:RUNNER_TEMP\mysqld.err.log" + +for ($i = 0; $i -lt 60; $i++) { + & "$bin\mysqladmin.exe" -u root ping *> $null + if ($LASTEXITCODE -eq 0) { break } + Start-Sleep -Seconds 1 +} +if ($LASTEXITCODE -ne 0) { throw 'mysqld did not start' } + +& "$bin\mysql.exe" -u root -e "CREATE DATABASE $env:TESTS_DB" +if ($LASTEXITCODE -ne 0) { throw 'create database failed' } +& "$bin\mysql.exe" -u root $env:TESTS_DB --execute="source examples/config/mysql/types/schema.sql; source examples/config/mysql/authors/schema.sql;" +if ($LASTEXITCODE -ne 0) { throw 'loading schemas failed' } +Write-Host 'mysql ready' diff --git a/.github/scripts/start-postgres.ps1 b/.github/scripts/start-postgres.ps1 new file mode 100644 index 00000000..6bd80607 --- /dev/null +++ b/.github/scripts/start-postgres.ps1 @@ -0,0 +1,19 @@ +# Starts the PostgreSQL service preinstalled on the Windows runner image and loads the test schemas. +$ErrorActionPreference = 'Stop' +$psql = Join-Path $env:PGROOT 'bin\psql.exe' +function Invoke-Psql { & $psql -v ON_ERROR_STOP=1 @args; if ($LASTEXITCODE -ne 0) { throw "psql failed: $args" } } + +Set-Service postgresql-x64-17 -StartupType Manual +Start-Service postgresql-x64-17 + +# The image sets the superuser password to 'root'; tests expect the one from .env +$env:PGPASSWORD = 'root' +Invoke-Psql -U postgres -c "CREATE DATABASE $env:TESTS_DB" +# tests don't need durability +Invoke-Psql -U postgres -c "ALTER SYSTEM SET fsync = off" -c "ALTER SYSTEM SET synchronous_commit = off" -c "ALTER SYSTEM SET full_page_writes = off" +Invoke-Psql -U postgres -c "SELECT pg_reload_conf()" +Invoke-Psql -U postgres -c "ALTER USER postgres PASSWORD '$env:POSTGRES_PASSWORD'" + +$env:PGPASSWORD = $env:POSTGRES_PASSWORD +Invoke-Psql -U postgres -d $env:TESTS_DB -f 'examples/config/postgresql/types/schema.sql' -f 'examples/config/postgresql/authors/schema.sql' +Write-Host 'postgres ready' diff --git a/.github/workflows/legacy-tests.yml b/.github/workflows/legacy-tests.yml index 0583682d..6213e168 100644 --- a/.github/workflows/legacy-tests.yml +++ b/.github/workflows/legacy-tests.yml @@ -58,26 +58,11 @@ jobs: - name: Start databases in the background shell: pwsh run: | - $pgBin = "$env:PGROOT\bin" - $mysqlBin = 'C:\Program Files\MySQL\MySQL Server 8.0\bin' - Set-Content -Path "$env:RUNNER_TEMP\start-dbs.ps1" -Value @" - `$ErrorActionPreference = 'Stop' - Set-Service postgresql-x64-17 -StartupType Manual - Start-Service postgresql-x64-17 - `$env:PGPASSWORD = 'root' - & '$pgBin\psql.exe' -U postgres -c "ALTER USER postgres PASSWORD '$env:POSTGRES_PASSWORD'" - & '$pgBin\psql.exe' -U postgres -c "CREATE DATABASE $env:TESTS_DB" - `$env:PGPASSWORD = '$env:POSTGRES_PASSWORD' - & '$pgBin\psql.exe' -U postgres -d $env:TESTS_DB -f 'examples/config/postgresql/types/schema.sql' -f 'examples/config/postgresql/authors/schema.sql' - - & '$mysqlBin\mysqld.exe' --initialize-insecure --console --datadir=C:\mysql-data - Start-Process -FilePath '$mysqlBin\mysqld.exe' -ArgumentList '--console','--datadir=C:\mysql-data','--local-infile=1' -WindowStyle Hidden - for (`$i = 0; `$i -lt 60; `$i++) { & '$mysqlBin\mysqladmin.exe' -u root ping 2>`$null; if (`$LASTEXITCODE -eq 0) { break }; Start-Sleep -Seconds 1 } - & '$mysqlBin\mysql.exe' -u root -e "SET GLOBAL local_infile=1; CREATE DATABASE $env:TESTS_DB;" - & '$mysqlBin\mysql.exe' -u root $env:TESTS_DB --execute="source examples/config/mysql/types/schema.sql; source examples/config/mysql/authors/schema.sql;" - "@ - Start-Process -FilePath pwsh -ArgumentList '-NoProfile','-File',"$env:RUNNER_TEMP\start-dbs.ps1" ` - -RedirectStandardOutput "$env:RUNNER_TEMP\dbs.log" -RedirectStandardError "$env:RUNNER_TEMP\dbs.err.log" -WindowStyle Hidden + foreach ($db in 'postgres', 'mysql') { + Start-Process -FilePath pwsh -WindowStyle Hidden ` + -ArgumentList '-NoProfile', '-File', ".github/scripts/start-$db.ps1" ` + -RedirectStandardOutput "$env:RUNNER_TEMP\$db.log" -RedirectStandardError "$env:RUNNER_TEMP\$db.err.log" + } - name: Restore and build test projects shell: pwsh @@ -93,16 +78,16 @@ jobs: - name: Wait for databases shell: pwsh run: | - $mysqlBin = 'C:\Program Files\MySQL\MySQL Server 8.0\bin' - $env:PGPASSWORD = $env:POSTGRES_PASSWORD - for ($i = 0; $i -lt 120; $i++) { - $pg = & "$env:PGROOT\bin\psql.exe" -U postgres -d $env:TESTS_DB -tAc "select to_regclass('public.authors') is not null" 2>$null - $my = & "$mysqlBin\mysql.exe" -u root -N -e "select count(*) from information_schema.tables where table_schema='$env:TESTS_DB'" 2>$null - if ($pg -eq 't' -and [int]$my -gt 0) { Write-Host "databases ready"; exit 0 } - Start-Sleep -Seconds 2 + $deadline = (Get-Date).AddMinutes(3) + foreach ($db in 'postgres', 'mysql') { + while (-not (Select-String -Path "$env:RUNNER_TEMP\$db.log" -Pattern "$db ready" -Quiet -ErrorAction SilentlyContinue)) { + if ((Get-Date) -gt $deadline) { + Get-ChildItem $env:RUNNER_TEMP -Filter "$db*.log" | ForEach-Object { Write-Host "--- $_"; Get-Content $_ } + throw "$db did not become ready" + } + Start-Sleep -Seconds 1 + } } - Get-Content "$env:RUNNER_TEMP\dbs.log", "$env:RUNNER_TEMP\dbs.err.log" -ErrorAction SilentlyContinue - exit 1 - name: Run Tests shell: powershell From ffb8cced6e69216472c3caa7f3a92e6fd2b6f6b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 19:44:08 +0000 Subject: [PATCH 4/7] Legacy e2e: drop postgres durability tweaks Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AuXKqNkqwnaoKv3sewFkRc --- .github/scripts/start-postgres.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/scripts/start-postgres.ps1 b/.github/scripts/start-postgres.ps1 index 6bd80607..95a4fb19 100644 --- a/.github/scripts/start-postgres.ps1 +++ b/.github/scripts/start-postgres.ps1 @@ -9,9 +9,6 @@ Start-Service postgresql-x64-17 # The image sets the superuser password to 'root'; tests expect the one from .env $env:PGPASSWORD = 'root' Invoke-Psql -U postgres -c "CREATE DATABASE $env:TESTS_DB" -# tests don't need durability -Invoke-Psql -U postgres -c "ALTER SYSTEM SET fsync = off" -c "ALTER SYSTEM SET synchronous_commit = off" -c "ALTER SYSTEM SET full_page_writes = off" -Invoke-Psql -U postgres -c "SELECT pg_reload_conf()" Invoke-Psql -U postgres -c "ALTER USER postgres PASSWORD '$env:POSTGRES_PASSWORD'" $env:PGPASSWORD = $env:POSTGRES_PASSWORD From a1d84b249561da8c927b0e40b6b10fbe985a817a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 19:49:23 +0000 Subject: [PATCH 5/7] Legacy e2e: run DB setup and build in one step, run MySQL as a service Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AuXKqNkqwnaoKv3sewFkRc --- .github/scripts/start-mysql.ps1 | 7 ++++--- .github/workflows/legacy-tests.yml | 30 ++++++++++++------------------ 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/scripts/start-mysql.ps1 b/.github/scripts/start-mysql.ps1 index d16954c3..a61daad2 100644 --- a/.github/scripts/start-mysql.ps1 +++ b/.github/scripts/start-mysql.ps1 @@ -7,9 +7,10 @@ $fast = '--skip-log-bin', '--innodb-flush-log-at-trx-commit=0', '--innodb-double & "$bin\mysqld.exe" --initialize-insecure --console "--datadir=$dataDir" @fast if ($LASTEXITCODE -ne 0) { throw 'mysqld --initialize-insecure failed' } -Start-Process -FilePath "$bin\mysqld.exe" -WindowStyle Hidden ` - -ArgumentList '--console', "--datadir=$dataDir", '--local-infile=1', @fast ` - -RedirectStandardOutput "$env:RUNNER_TEMP\mysqld.log" -RedirectStandardError "$env:RUNNER_TEMP\mysqld.err.log" +# a service (unlike a child process) survives the end of the workflow step +& "$bin\mysqld.exe" --install MySQL "--datadir=$dataDir" --local-infile=1 @fast +if ($LASTEXITCODE -ne 0) { throw 'mysqld --install failed' } +Start-Service MySQL for ($i = 0; $i -lt 60; $i++) { & "$bin\mysqladmin.exe" -u root ping *> $null diff --git a/.github/workflows/legacy-tests.yml b/.github/workflows/legacy-tests.yml index 6213e168..8bbec619 100644 --- a/.github/workflows/legacy-tests.yml +++ b/.github/workflows/legacy-tests.yml @@ -54,40 +54,34 @@ jobs: # PostgreSQL 17 and MySQL 8.0 come preinstalled on the Windows runner image - using them is much faster than # downloading and installing them (setup-postgres ~3.5 min, choco mysql ~2 min). - # Both databases are started in the background while the test projects are restored and built. - - name: Start databases in the background + # Both databases are set up in the background while the test projects are restored and built. This has to be + # a single step: child processes do not outlive the step that started them (the database services do). + - name: Set up databases and build test projects in parallel shell: pwsh run: | - foreach ($db in 'postgres', 'mysql') { - Start-Process -FilePath pwsh -WindowStyle Hidden ` + $dbJobs = foreach ($db in 'postgres', 'mysql') { + Start-Process -FilePath pwsh -PassThru -WindowStyle Hidden ` -ArgumentList '-NoProfile', '-File', ".github/scripts/start-$db.ps1" ` -RedirectStandardOutput "$env:RUNNER_TEMP\$db.log" -RedirectStandardError "$env:RUNNER_TEMP\$db.err.log" } - - name: Restore and build test projects - shell: pwsh - run: | Get-ChildItem -Path examples -Recurse -Filter *.csproj | Where-Object { $_.FullName -like '*Legacy*' } | ForEach-Object { nuget restore $_.FullName } nuget restore ./end2end/EndToEndCommon/EndToEndCommon.csproj nuget restore ./end2end/EndToEndTestsLegacy/EndToEndTestsLegacy.csproj msbuild.exe ./end2end/EndToEndTestsLegacy/EndToEndTestsLegacy.csproj -p:Configuration=Release -p:FrameworkVersion=v4.7.2 -m - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $buildExit = $LASTEXITCODE - - name: Wait for databases - shell: pwsh - run: | - $deadline = (Get-Date).AddMinutes(3) + $dbJobs | Wait-Process -Timeout 180 + $failed = $false foreach ($db in 'postgres', 'mysql') { - while (-not (Select-String -Path "$env:RUNNER_TEMP\$db.log" -Pattern "$db ready" -Quiet -ErrorAction SilentlyContinue)) { - if ((Get-Date) -gt $deadline) { - Get-ChildItem $env:RUNNER_TEMP -Filter "$db*.log" | ForEach-Object { Write-Host "--- $_"; Get-Content $_ } - throw "$db did not become ready" - } - Start-Sleep -Seconds 1 + if (-not (Select-String -Path "$env:RUNNER_TEMP\$db.log" -Pattern "$db ready" -Quiet)) { + Get-ChildItem $env:RUNNER_TEMP -Filter "$db*.log" | ForEach-Object { Write-Host "--- $_"; Get-Content $_ } + $failed = $true } } + if ($buildExit -ne 0 -or $failed) { exit 1 } - name: Run Tests shell: powershell From c75657d3c6827e00f37e99e7a76bec24c27c292a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 19:51:51 +0000 Subject: [PATCH 6/7] Legacy e2e: install MySQL service via defaults file Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AuXKqNkqwnaoKv3sewFkRc --- .github/scripts/start-mysql.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/scripts/start-mysql.ps1 b/.github/scripts/start-mysql.ps1 index a61daad2..0b831daf 100644 --- a/.github/scripts/start-mysql.ps1 +++ b/.github/scripts/start-mysql.ps1 @@ -2,13 +2,21 @@ $ErrorActionPreference = 'Stop' $bin = 'C:\Program Files\MySQL\MySQL Server 8.0\bin' $dataDir = 'C:\mysql-data' -$fast = '--skip-log-bin', '--innodb-flush-log-at-trx-commit=0', '--innodb-doublewrite=0' +$ini = "$env:RUNNER_TEMP\my.ini" +Set-Content -Path $ini -Value @" +[mysqld] +datadir=$($dataDir -replace '\\', '/') +local-infile=1 +skip-log-bin +innodb-flush-log-at-trx-commit=0 +innodb-doublewrite=0 +"@ -& "$bin\mysqld.exe" --initialize-insecure --console "--datadir=$dataDir" @fast +& "$bin\mysqld.exe" --initialize-insecure --console "--defaults-file=$ini" if ($LASTEXITCODE -ne 0) { throw 'mysqld --initialize-insecure failed' } # a service (unlike a child process) survives the end of the workflow step -& "$bin\mysqld.exe" --install MySQL "--datadir=$dataDir" --local-infile=1 @fast +& "$bin\mysqld.exe" --install MySQL "--defaults-file=$ini" if ($LASTEXITCODE -ne 0) { throw 'mysqld --install failed' } Start-Service MySQL From 69cbd2f8d69c11756237bdf861fd91feea26f441 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 19:53:45 +0000 Subject: [PATCH 7/7] Legacy e2e: pass --defaults-file first to mysqld Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AuXKqNkqwnaoKv3sewFkRc --- .github/scripts/start-mysql.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/start-mysql.ps1 b/.github/scripts/start-mysql.ps1 index 0b831daf..6dacf6fe 100644 --- a/.github/scripts/start-mysql.ps1 +++ b/.github/scripts/start-mysql.ps1 @@ -12,7 +12,7 @@ innodb-flush-log-at-trx-commit=0 innodb-doublewrite=0 "@ -& "$bin\mysqld.exe" --initialize-insecure --console "--defaults-file=$ini" +& "$bin\mysqld.exe" "--defaults-file=$ini" --initialize-insecure --console if ($LASTEXITCODE -ne 0) { throw 'mysqld --initialize-insecure failed' } # a service (unlike a child process) survives the end of the workflow step