From 39920931b1235d2090bbdce95d92ec7d88195985 Mon Sep 17 00:00:00 2001 From: cppla Date: Wed, 23 Sep 2026 10:15:19 +0800 Subject: [PATCH 1/2] test: handle Windows UDP fixture port reuse --- .github/workflows/ci.yml | 13 +++++++++++++ internal/tunnel/datagram_icmp_recovery_test.go | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d710c7..eef4934 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,19 @@ jobs: - name: Test run: go test -shuffle=on -count=1 ./... + windows-udp-test: + name: Windows UDP continuity (Go 1.25.13) + runs-on: windows-2022 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version: 1.25.13 + cache: true + - name: Exercise native UDP continuity and platform bind errors + run: go test ./internal/tunnel -run '^(TestWebTestAddressInUse|TestQUICDatagramClosedPortPreservesAssociation)$' -count=5 -timeout=60s -v + race: name: Race detector runs-on: ubuntu-24.04 diff --git a/internal/tunnel/datagram_icmp_recovery_test.go b/internal/tunnel/datagram_icmp_recovery_test.go index a6b5406..77e41ae 100644 --- a/internal/tunnel/datagram_icmp_recovery_test.go +++ b/internal/tunnel/datagram_icmp_recovery_test.go @@ -9,7 +9,6 @@ import ( "runtime" "sync" "sync/atomic" - "syscall" "testing" "time" @@ -205,7 +204,7 @@ func TestQUICDatagramClosedPortPreservesAssociation(t *testing.T) { // closed-destination write attempt before reopening the guard socket. checkEcho([]byte{byte(round), 'o', 'k'}) guard, err = net.ListenUDP("udp4", closedEndpoint) - if errors.Is(err, syscall.EADDRINUSE) { + if isWebTestAddressInUse(err) { t.Skip("closed-port fixture became inconclusive: another socket reused the port") } if err != nil { From 55a52ae20a26a74e09ba20d96b34c56b3a034ee7 Mon Sep 17 00:00:00 2001 From: cppla Date: Wed, 23 Sep 2026 10:20:34 +0800 Subject: [PATCH 2/2] ci: require five actual Windows UDP test passes --- .github/workflows/ci.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eef4934..492a42f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,21 @@ jobs: go-version: 1.25.13 cache: true - name: Exercise native UDP continuity and platform bind errors - run: go test ./internal/tunnel -run '^(TestWebTestAddressInUse|TestQUICDatagramClosedPortPreservesAssociation)$' -count=5 -timeout=60s -v + shell: pwsh + run: | + $testOutput = & go test ./internal/tunnel -run '^(TestWebTestAddressInUse|TestQUICDatagramClosedPortPreservesAssociation)$' -count=5 -timeout=60s -json + $testExit = $LASTEXITCODE + $testOutput | Write-Output + if ($testExit -ne 0) { exit $testExit } + $testEvents = @($testOutput | ForEach-Object { $_ | ConvertFrom-Json -ErrorAction Stop }) + foreach ($testName in @('TestWebTestAddressInUse', 'TestQUICDatagramClosedPortPreservesAssociation')) { + $passes = @($testEvents | Where-Object { $_.Test -eq $testName -and $_.Action -eq 'pass' }).Count + $skips = @($testEvents | Where-Object { $_.Test -eq $testName -and $_.Action -eq 'skip' }).Count + if ($passes -ne 5 -or $skips -ne 0) { + throw "$testName requires exactly 5 passes and 0 skips; got $passes passes and $skips skips" + } + Write-Output "Verified ${testName}: $passes passes, $skips skips" + } race: name: Race detector