fix(lab): schedule all T-014 stability samples [T-014]
Harness governance / validate (push) Has been cancelled

This commit is contained in:
QiuSW
2026-08-08 11:18:46 +08:00
parent c3cfaff614
commit 71e5e6e599
2 changed files with 11 additions and 3 deletions
+9 -3
View File
@@ -802,9 +802,14 @@ try {
$previousSampleAt = 0.0 $previousSampleAt = 0.0
$initialInventory = Get-MediaInventory $script:productionAPIPort $initialInventory = Get-MediaInventory $script:productionAPIPort
$samples = 0 $samples = 0
$requiredSamples = [int][Math]::Ceiling($targetSeconds / $sampleSeconds)
$maximumUnconverged = 0 $maximumUnconverged = 0
while ($observation.Elapsed.TotalSeconds -lt $targetSeconds) { while ($samples -lt $requiredSamples) {
Start-Sleep -Seconds $sampleSeconds $nextSampleAt = ($samples + 1) * $sampleSeconds
$delayMilliseconds = [int][Math]::Ceiling(($nextSampleAt - $observation.Elapsed.TotalSeconds) * 1000)
if ($delayMilliseconds -gt 0) {
Start-Sleep -Milliseconds $delayMilliseconds
}
Assert-Alive $sourceMedia Assert-Alive $sourceMedia
Assert-Alive $productionMedia Assert-Alive $productionMedia
Assert-Alive $sense Assert-Alive $sense
@@ -848,7 +853,8 @@ try {
$inboundMbps = if ($observationSeconds -gt 0) { ($inboundDelta * 8.0) / $observationSeconds / 1000000.0 } else { 0.0 } $inboundMbps = if ($observationSeconds -gt 0) { ($inboundDelta * 8.0) / $observationSeconds / 1000000.0 } else { 0.0 }
$databaseSizeBytes = [Int64](Get-PostgresScalar "SELECT pg_database_size('$databaseName')") $databaseSizeBytes = [Int64](Get-PostgresScalar "SELECT pg_database_size('$databaseName')")
$finalUnconverged = [int](Get-SenseMetric 'sense_reconcile_devices' '{state="unconverged"}') $finalUnconverged = [int](Get-SenseMetric 'sense_reconcile_devices' '{state="unconverged"}')
if ($finalUnconverged -ne 0 -or $maximumUnconverged -ne 0 -or $samples -lt [Math]::Floor($targetSeconds / $sampleSeconds)) { if ($observationSeconds -lt $targetSeconds -or $finalUnconverged -ne 0 -or
$maximumUnconverged -ne 0 -or $samples -lt $requiredSamples) {
throw 'formal observation did not satisfy sampling and convergence requirements' throw 'formal observation did not satisfy sampling and convergence requirements'
} }
+2
View File
@@ -32,6 +32,8 @@ class SenseCapacityContractTests(unittest.TestCase):
def test_formal_window_and_functional_gates_are_fixed(self): def test_formal_window_and_functional_gates_are_fixed(self):
self.assertRegex(self.script, r"\[int\]\$ObservationMinutes = 30") self.assertRegex(self.script, r"\[int\]\$ObservationMinutes = 30")
self.assertIn("$sampleSeconds = 10", self.script) self.assertIn("$sampleSeconds = 10", self.script)
self.assertIn("$requiredSamples = [int][Math]::Ceiling($targetSeconds / $sampleSeconds)", self.script)
self.assertIn("$nextSampleAt = ($samples + 1) * $sampleSeconds", self.script)
self.assertIn("formal_eligible = $ObservationMinutes -ge 30", self.script) self.assertIn("formal_eligible = $ObservationMinutes -ge 30", self.script)
self.assertIn("Wait-Convergence 'enabled'", self.script) self.assertIn("Wait-Convergence 'enabled'", self.script)
self.assertIn("Wait-Convergence 'disabled'", self.script) self.assertIn("Wait-Convergence 'disabled'", self.script)