Skip to content

Commit cbac282

Browse files
committed
ci: restore e2e cells and fix matrix expansion across 2019/2022/2025
The prior matrix used a top-level `os` axis plus `include` entries keyed only on variant/expect. GHA merged each include entry into all existing os-only cells in a non-deterministic order, which collapsed the grid to three buggy-only cells with no fixed counterpart — that's the regression observed on the last run. Switch to a fully-explicit 12-cell include list: 3 OS × 2 variants × 2 test_kinds (unit + e2e). Restore the 3.5-minute real-service inactivity e2e step (build Vector, emit marker event, sleep 210s, emit second marker, assert delivery within 30s). Route the expectation checks through the outcome of whichever step the cell ran.
1 parent c0cefe1 commit cbac282

1 file changed

Lines changed: 173 additions & 41 deletions

File tree

‎.github/workflows/issue-25194-ab-validate.yml‎

Lines changed: 173 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
name: Issue 25194 A/B Validation
22

33
# Proves the fix for vectordotdev/vector#25194 (windows_event_log lost-wakeup race)
4-
# by running the deterministic regression tests across three Windows Server
5-
# versions against two cells:
4+
# by running both the deterministic unit regression tests and a 3.5-minute
5+
# real-service end-to-end inactivity test on Windows Server 2019, 2022, and 2025,
6+
# each against two cells:
67
#
7-
# - fixed: current PR head (tot19/fix-windows-event-log-lost-wakeup-25194) → tests must PASS
8+
# - fixed: current PR head (tot19/fix-windows-event-log-lost-wakeup-25194) → expect PASS
89
# - buggy: same PR head with the three production fix hunks surgically reverted
9-
# (matches the pre-fix upstream code that will ship as v0.55) → tests must FAIL
10+
# (matches the upstream pre-fix code scheduled for v0.55) → expect FAIL
1011
#
11-
# The embedded base64 patch (APPLY_PATCH_B64) is a forward "fixed → buggy" diff
12-
# that undoes only the three production hunks in `pull_events` (pre-drain
13-
# ResetEvent, error-path SetEvent re-arm, post-drain ResetEvent → else-branch
14-
# SetEvent) plus the corresponding SetEvent import change. It keeps the
15-
# DRAIN_STEP_HOOK static, the test-hook call inside the drain loop, the
16-
# `first_channel_signal_raw` accessor, and the regression tests themselves —
17-
# so the same tests run on both cells and the only variable is the production
18-
# drain-loop code.
19-
#
20-
# Each (os × variant) cell runs unit-only. The end-to-end cells were removed
21-
# because the PR's speculative timeout pull (commit 873d0c8f7f) self-heals
22-
# the race at the mod.rs layer regardless of the subscription.rs bug, making
23-
# e2e inactivity tests unable to discriminate the two cells. The deterministic
24-
# unit tests pin the exact invariants under test.
12+
# The embedded base64 patch is a forward "fixed -> buggy" diff that undoes only the
13+
# three production hunks in `pull_events` (pre-drain ResetEvent, error-path SetEvent
14+
# re-arm, post-drain ResetEvent -> else-branch SetEvent) plus the corresponding
15+
# SetEvent import change. It keeps the DRAIN_STEP_HOOK static, the test-hook call
16+
# inside the drain loop, the `first_channel_signal_raw` accessor, and the regression
17+
# tests themselves -- so the same tests run on both cells and the only variable is
18+
# the production drain-loop code.
2519

2620
on:
2721
workflow_dispatch:
@@ -34,18 +28,61 @@ permissions:
3428

3529
jobs:
3630
ab-test:
37-
name: ${{ matrix.os }}/${{ matrix.variant }} (expect ${{ matrix.expect }})
31+
name: ${{ matrix.os }}/${{ matrix.variant }}/${{ matrix.test_kind }} (expect ${{ matrix.expect }})
3832
runs-on: ${{ matrix.os }}
39-
timeout-minutes: 45
33+
timeout-minutes: 60
4034
strategy:
4135
fail-fast: false
4236
matrix:
43-
os: [windows-2025, windows-2022, windows-2019]
4437
include:
45-
- variant: fixed
38+
- os: windows-2025
39+
variant: fixed
40+
expect: pass
41+
test_kind: unit
42+
- os: windows-2025
43+
variant: fixed
44+
expect: pass
45+
test_kind: e2e
46+
- os: windows-2025
47+
variant: buggy
48+
expect: fail
49+
test_kind: unit
50+
- os: windows-2025
51+
variant: buggy
52+
expect: fail
53+
test_kind: e2e
54+
- os: windows-2022
55+
variant: fixed
56+
expect: pass
57+
test_kind: unit
58+
- os: windows-2022
59+
variant: fixed
60+
expect: pass
61+
test_kind: e2e
62+
- os: windows-2022
63+
variant: buggy
64+
expect: fail
65+
test_kind: unit
66+
- os: windows-2022
67+
variant: buggy
68+
expect: fail
69+
test_kind: e2e
70+
- os: windows-2019
71+
variant: fixed
72+
expect: pass
73+
test_kind: unit
74+
- os: windows-2019
75+
variant: fixed
4676
expect: pass
47-
- variant: buggy
77+
test_kind: e2e
78+
- os: windows-2019
79+
variant: buggy
4880
expect: fail
81+
test_kind: unit
82+
- os: windows-2019
83+
variant: buggy
84+
expect: fail
85+
test_kind: e2e
4986
steps:
5087
- name: Checkout PR branch (fixed baseline)
5188
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -139,8 +176,6 @@ jobs:
139176
B64_EOF
140177
echo "--- patch size ---"
141178
wc -c apply_revert.patch
142-
echo "--- first 5 patch lines ---"
143-
head -5 apply_revert.patch
144179
echo "--- applying forward patch (fixed -> buggy) ---"
145180
git apply --check apply_revert.patch
146181
git apply apply_revert.patch
@@ -156,6 +191,7 @@ jobs:
156191
run: .\scripts\environment\bootstrap-windows-2025.ps1
157192

158193
- name: Run lost-wakeup regression tests (unit)
194+
if: matrix.test_kind == 'unit'
159195
id: run-unit-tests
160196
shell: bash
161197
continue-on-error: true
@@ -167,29 +203,132 @@ jobs:
167203
test_speculative_pull_recovers_without_signal \
168204
-- --nocapture
169205
206+
- name: Build Vector binary (e2e)
207+
if: matrix.test_kind == 'e2e'
208+
shell: bash
209+
run: |
210+
cargo build -p vector --no-default-features \
211+
--features sources-windows_event_log,sinks-file
212+
213+
- name: Run real-service inactivity test (e2e, 3.5min)
214+
if: matrix.test_kind == 'e2e'
215+
id: run-e2e-test
216+
shell: pwsh
217+
continue-on-error: true
218+
run: |
219+
$ErrorActionPreference = "Stop"
220+
$run = [guid]::NewGuid().ToString("N")
221+
$marker1 = "E2E_EVENT_1_$run"
222+
$marker2 = "E2E_EVENT_2_$run"
223+
$sink = Join-Path $env:RUNNER_TEMP "sink.log"
224+
$cfg = Join-Path $env:RUNNER_TEMP "vector.yaml"
225+
$chk = Join-Path $env:RUNNER_TEMP "checkpoints"
226+
New-Item -ItemType Directory -Force -Path $chk | Out-Null
227+
Remove-Item -Force $sink -ErrorAction SilentlyContinue
228+
229+
@"
230+
data_dir: "$($chk -replace '\\','/')"
231+
sources:
232+
weventlog:
233+
type: windows_event_log
234+
channels: ["Application"]
235+
read_existing_events: false
236+
batch_size: 16
237+
sinks:
238+
outfile:
239+
type: file
240+
inputs: ["weventlog"]
241+
path: "$($sink -replace '\\','/')"
242+
encoding:
243+
codec: json
244+
"@ | Set-Content -Path $cfg -Encoding utf8
245+
246+
Write-Host "--- config ---"; Get-Content $cfg
247+
248+
$vectorExe = ".\target\debug\vector.exe"
249+
$proc = Start-Process -FilePath $vectorExe `
250+
-ArgumentList "--config-yaml", $cfg `
251+
-PassThru `
252+
-RedirectStandardOutput (Join-Path $env:RUNNER_TEMP "vector.out") `
253+
-RedirectStandardError (Join-Path $env:RUNNER_TEMP "vector.err")
254+
Write-Host "Started vector pid=$($proc.Id)"
255+
256+
Start-Sleep -Seconds 15
257+
if ($proc.HasExited) {
258+
Write-Host "Vector exited early. stderr:"
259+
Get-Content (Join-Path $env:RUNNER_TEMP "vector.err")
260+
exit 2
261+
}
262+
263+
Write-Host "--- emitting event 1 ($marker1) ---"
264+
& eventcreate /T INFORMATION /ID 100 /L APPLICATION /SO VectorE2E25194 /D $marker1 | Out-Null
265+
if ($LASTEXITCODE -ne 0) { Write-Host "eventcreate 1 failed"; exit 2 }
266+
267+
$found1 = $false
268+
for ($i = 0; $i -lt 30; $i++) {
269+
if ((Test-Path $sink) -and (Select-String -Path $sink -Pattern $marker1 -Quiet -ErrorAction SilentlyContinue)) {
270+
$found1 = $true; break
271+
}
272+
Start-Sleep -Seconds 1
273+
}
274+
if (-not $found1) {
275+
Write-Host "::error::Event 1 never delivered -- plumbing broken, cannot test race"
276+
Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue
277+
exit 2
278+
}
279+
Write-Host "Event 1 delivered in <=30s -- plumbing OK"
280+
281+
Write-Host "--- sleeping 210s to trigger 3.5min inactivity window ---"
282+
Start-Sleep -Seconds 210
283+
284+
Write-Host "--- emitting event 2 ($marker2) ---"
285+
& eventcreate /T INFORMATION /ID 200 /L APPLICATION /SO VectorE2E25194 /D $marker2 | Out-Null
286+
if ($LASTEXITCODE -ne 0) { Write-Host "eventcreate 2 failed"; exit 2 }
287+
288+
$found2 = $false
289+
for ($i = 0; $i -lt 30; $i++) {
290+
if (Select-String -Path $sink -Pattern $marker2 -Quiet -ErrorAction SilentlyContinue) {
291+
$found2 = $true; break
292+
}
293+
Start-Sleep -Seconds 1
294+
}
295+
296+
Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue
297+
298+
Write-Host "--- sink contents ---"
299+
if (Test-Path $sink) { Get-Content $sink | Select-Object -Last 20 }
300+
301+
if ($found2) {
302+
Write-Host "Event 2 delivered within 30s of inactivity -- subscription did NOT freeze"
303+
exit 0
304+
} else {
305+
Write-Host "Event 2 NOT delivered within 30s -- subscription appears frozen (lost-wakeup symptom)"
306+
exit 1
307+
}
308+
170309
- name: Check fixed-cell expectation
171310
if: matrix.variant == 'fixed'
172311
shell: bash
173312
env:
174-
OUTCOME: ${{ steps.run-unit-tests.outcome }}
313+
OUTCOME: ${{ matrix.test_kind == 'unit' && steps.run-unit-tests.outcome || steps.run-e2e-test.outcome }}
175314
run: |
176315
if [ "$OUTCOME" != "success" ]; then
177-
echo "::error::Fixed cell on ${{ matrix.os }} FAILED — the fix does not resolve the race, or the test itself is broken"
316+
echo "::error::Fixed cell ${{ matrix.os }}/${{ matrix.test_kind }} FAILED -- the fix does not resolve the race, or the test itself is broken"
178317
exit 1
179318
fi
180-
echo "Fixed cell on ${{ matrix.os }}: regression tests PASSED as expected — fix resolves #25194"
319+
echo "Fixed cell ${{ matrix.os }}/${{ matrix.test_kind }}: PASSED as expected -- fix resolves #25194"
181320
182321
- name: Check buggy-cell expectation
183322
if: matrix.variant == 'buggy'
184323
shell: bash
185324
env:
186-
OUTCOME: ${{ steps.run-unit-tests.outcome }}
325+
OUTCOME: ${{ matrix.test_kind == 'unit' && steps.run-unit-tests.outcome || steps.run-e2e-test.outcome }}
187326
run: |
188327
if [ "$OUTCOME" = "success" ]; then
189-
echo "::error::Buggy cell on ${{ matrix.os }} PASSED — the regression tests are not actually catching the bug (false-pass)"
328+
echo "::error::Buggy cell ${{ matrix.os }}/${{ matrix.test_kind }} PASSED -- the test did not catch the bug (false-pass)"
190329
exit 1
191330
fi
192-
echo "Buggy cell on ${{ matrix.os }}: regression tests FAILED as expected — proves the tests catch #25194 and the fix is load-bearing"
331+
echo "Buggy cell ${{ matrix.os }}/${{ matrix.test_kind }}: FAILED as expected -- proves the test catches #25194 and the fix is load-bearing"
193332
194333
summary:
195334
needs: ab-test
@@ -205,18 +344,11 @@ jobs:
205344
if [ "${{ needs.ab-test.result }}" = "success" ]; then
206345
echo "Result: **PASS**"
207346
echo ""
208-
echo "Ran deterministic regression tests on three Windows Server versions × two cells:"
209-
echo ""
210-
echo "- **windows-2025 / fixed**: tests PASSED → fix resolves the lost-wakeup race on Windows Server 2025."
211-
echo "- **windows-2025 / buggy**: tests FAILED on reverted code → tests discriminate; fix is load-bearing on 2025."
212-
echo "- **windows-2022 / fixed**: tests PASSED → fix holds on Windows Server 2022."
213-
echo "- **windows-2022 / buggy**: tests FAILED on reverted code → tests discriminate on 2022."
214-
echo "- **windows-2019 / fixed**: tests PASSED → fix holds on Windows Server 2019."
215-
echo "- **windows-2019 / buggy**: tests FAILED on reverted code → tests discriminate on 2019."
347+
echo "Ran unit + 3.5min real-service e2e tests on Windows Server 2019, 2022, and 2025, each on two cells (fixed PR head vs surgically-reverted v0.55-baseline buggy cell)."
216348
echo ""
217-
echo "Baseline for \"buggy\" cells matches upstream pre-fix code that will ship as v0.55."
349+
echo "All fixed cells passed and all buggy cells failed as expected -- the tests discriminate cleanly and the fix is load-bearing across all three Windows Server versions."
218350
else
219-
echo "Result: **FAIL** — see individual cell logs."
351+
echo "Result: **FAIL** -- see individual cell logs."
220352
fi
221353
} >> "$GITHUB_STEP_SUMMARY"
222354
[ "${{ needs.ab-test.result }}" = "success" ]

0 commit comments

Comments
 (0)