fix(agent99): tolerate fresh durable alerts during deploy
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m59s
CD Pipeline / build-and-deploy (push) Successful in 12m2s
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 0s
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Successful in 19s
CD Pipeline / post-deploy-checks (push) Successful in 2m9s

This commit is contained in:
ogt
2026-07-14 21:13:32 +08:00
parent 4edd802497
commit 3de0ba821e
4 changed files with 36 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ def _base_case() -> dict[str, Any]:
"selfHealthPerformanceIssueCount": 0,
"staleAlertExecutionCount": 0,
"alertIncomingCount": 0,
"staleAlertIncomingCount": 0,
"pendingCommandCount": 0,
}
@@ -82,6 +83,7 @@ $parameters = @{{
SelfHealthPerformanceIssueCount = [int]$case.selfHealthPerformanceIssueCount
StaleAlertExecutionCount = [int]$case.staleAlertExecutionCount
AlertIncomingCount = [int]$case.alertIncomingCount
StaleAlertIncomingCount = [int]$case.staleAlertIncomingCount
PendingCommandCount = [int]$case.pendingCommandCount
}}
Get-AgentLivePreflightDecision @parameters |
@@ -106,6 +108,7 @@ def test_warning_receipt_is_visible_without_weakening_integrity_blockers() -> No
assert '$warningReasons += "self_health_warning"' in decision
assert '$warningReasons += "performance_warning"' in decision
assert '$warningReasons += "fresh_alert_pending_next_inbox_tick"' in decision
assert '"critical" { $blockingReasons += "self_health_critical" }' in decision
assert 'default { $blockingReasons += "self_health_unclassified" }' in decision
assert '$blockingReasons += "runtime_manifest_identity_invalid"' in decision
@@ -172,6 +175,27 @@ def test_decision_behavior_when_powershell_is_available() -> None:
("sre_alert_relay_not_listening",),
(),
),
(
_with_overrides(alertIncomingCount=1),
True,
(),
("fresh_alert_pending_next_inbox_tick",),
),
(
_with_overrides(
alertIncomingCount=1,
staleAlertIncomingCount=1,
),
False,
("pending_work_before_reboot",),
(),
),
(
_with_overrides(pendingCommandCount=1),
False,
("pending_work_before_reboot",),
(),
),
)
for case, expected_eligible, expected_blockers, expected_warnings in cases:

View File

@@ -513,7 +513,8 @@ def test_receiver_scopes_deploy_health_separately_from_external_asset_health() -
assert '$_ -ne "self_health_not_ok"' in preflight
assert '[int]$summary.healthyTaskCount -eq [int]$summary.requiredTaskCount' in preflight
assert '[int]$summary.requiredEvidenceFailureCount -eq 0' in preflight
assert '[int]$summary.alertIncomingCount -eq 0' in preflight
assert '[int]$summary.alertIncomingStaleCount -eq 0' in preflight
assert '[int]$summary.alertIncomingCount -eq 0' not in preflight
assert '[int]$summary.alertRunningCount -eq 0' in preflight
assert '[int]$summary.pendingCommandCount -eq 0' in preflight
assert '$runtimePlaneBlockingReasons.Count -eq 0' in preflight
@@ -651,4 +652,4 @@ def test_check_mode_builds_and_streams_bundle_over_bounded_fake_transport(
assert "Administrator@192.168.0.99" in args
assert str(identity) in args
payload_bytes = int(bytes_path.read_text(encoding="utf-8"))
assert 50_000 < payload_bytes < 500_000
assert 50_000 < payload_bytes < 1_048_576