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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ jobs:

- name: Windows test-cost ratchet
if: needs.changes.result == 'success' && matrix.os == 'windows-latest' && (contains(github.event.pull_request.labels.*.name, 'allow-test-cost-growth') || contains(github.event.pull_request.labels.*.name, 'run-test-cost') || contains(github.event.pull_request.labels.*.name, 'test-cost') || needs.changes.outputs.test_cost == 'true')
timeout-minutes: 20
timeout-minutes: 30
shell: pwsh
env:
# A labeled PR may authorize a ratchet update, but the orchestrator
Expand Down
6 changes: 6 additions & 0 deletions internal/core/runtime/parallel_race_late_arm_race_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ func TestTryOpenParallelGroup_ContextDoneLateArmStillTerminalized(t *testing.T)
t.Fatal("tryOpenParallelGroup did not return after release")
}

deadline := time.Now().Add(5 * time.Second)
for time.Now().Before(deadline) &&
(fastStream.cancelCount.Load() == 0 && fastStream.closeCount.Load() == 0 ||
lateStream.cancelCount.Load() == 0 && lateStream.closeCount.Load() == 0) {
time.Sleep(10 * time.Millisecond)
}
if fastStream.cancelCount.Load() == 0 && fastStream.closeCount.Load() == 0 {
t.Errorf("expected fast arm to be terminalized (cancel or close)")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/qa/ci_iteration_speed_contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ func TestQAFastPreflight_TestCostRatchetContracts(t *testing.T) {
t.Fatal("CI must place the Windows test-cost ratchet before building the release binary")
}
ratchetBlock := ci[ratchet:buildBinary]
if !strings.Contains(ratchetBlock, "timeout-minutes: 20") {
t.Fatal("Windows test-cost ratchet step must declare timeout-minutes: 20")
if !strings.Contains(ratchetBlock, "timeout-minutes: 30") {
t.Fatal("Windows test-cost ratchet step must declare timeout-minutes: 30")
}
if !strings.Contains(ratchetBlock, "& ./scripts/test-cost-ratchet.ps1") {
t.Fatal("Windows test-cost ratchet step must invoke & ./scripts/test-cost-ratchet.ps1 directly")
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-cost-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"quality-checks": {
"cpu": { "ratio": 1.30, "delta_seconds": 5 },
"processes": { "ratio": 1.15, "delta": 6 },
"processes": { "ratio": 1.15, "delta": 8 },
"io_operations": { "ratio": 1.40, "delta": 7500 },
"wall": { "ratio": 1.50, "delta_seconds": 10 }
},
Expand Down
31 changes: 31 additions & 0 deletions scripts/test-cost-ratchet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,36 @@ function Apply-AnchorCompatibilityPatch {
Test-CleanCheckout $AnchorRoot
}

function Apply-CurrentAnchorLoadCompatibilityPatch {
param(
[Parameter(Mandatory = $true)][string]$RepositoryRoot,
[Parameter(Mandatory = $true)][string]$AnchorRoot,
[Parameter(Mandatory = $true)][string]$AnchorCommit
)

$currentAnchor = "6dbb831885341516117034923f0c3203373aded0"
if ($AnchorCommit -ne $currentAnchor) {
return
}

# The pinned anchor's late-arm assertion must wait for asynchronous
# terminalization when the full suite saturates a Windows runner.
$relativePath = "internal/core/runtime/parallel_race_late_arm_race_test.go"
Copy-Item -LiteralPath (Join-Path $RepositoryRoot $relativePath) -Destination (Join-Path $AnchorRoot $relativePath) -Force
$absolutePath = Join-Path $AnchorRoot $relativePath
$content = [IO.File]::ReadAllText($absolutePath)
[IO.File]::WriteAllText($absolutePath, $content.Replace("`r`n", "`n"), [Text.UTF8Encoding]::new($false))
Invoke-GitChecked @("-C", $AnchorRoot, "add", "--", $relativePath)
Invoke-GitChecked @(
"-C", $AnchorRoot,
"-c", "user.name=Go-LIP test-cost ratchet",
"-c", "user.email=test-cost-ratchet@invalid.local",
"-c", "commit.gpgsign=false",
"commit", "-m", "test: stabilize pinned anchor late-arm assertion"
)
Test-CleanCheckout $AnchorRoot
}

function Build-TestCostBinary {
param(
[Parameter(Mandatory = $true)][string]$Label,
Expand Down Expand Up @@ -588,6 +618,7 @@ try {
)
$anchorCreated = $true
Apply-AnchorCompatibilityPatch $RepositoryRoot $anchorRoot $AnchorCommit $anchorTempRoot
Apply-CurrentAnchorLoadCompatibilityPatch $RepositoryRoot $anchorRoot $AnchorCommit

# The committed anchor predates the ratchet tool itself. Build the neutral
# measurement wrapper once from head, then point it at each source tree.
Expand Down