mirror of
https://github.com/lahfir/agent-desktop.git
synced 2026-07-30 02:39:18 +00:00
test: widen wall-clock budgets on retry/hydration tests to stop CI flakes
A class of unit tests bounds real retry/resolve/hydration work with a tight wall-clock deadline (100-1000 ms) and asserts a definite outcome (success, or a specific terminal code after a bounded retry). On slow, contended GitHub runners the work overran the budget and the test got a Timeout instead of its asserted outcome, flaking the Test job while every local run passed. Widen those budgets to the suite's 5 s idiom so the asserted state is reached deterministically. Genuine deadline-expiry tests (permanently-unresolvable adapters, single-shot timeout_ms 0, deadline-value plumbing, lock-contention) keep their tight budgets - a slow runner still expires them correctly. Test-only; no production change.
This commit is contained in:
parent
24ba049ec4
commit
dbddec98b8
12 changed files with 13 additions and 13 deletions
|
|
@ -114,7 +114,7 @@ fn drag_retries_transient_post_focus_occlusion_without_holding_lease() {
|
|||
let snapshot_id = cross_app_snapshot();
|
||||
let adapter = TransientOcclusionAdapter::new();
|
||||
let mut args = cross_app_args(snapshot_id);
|
||||
args.timeout_ms = Some(500);
|
||||
args.timeout_ms = Some(5_000);
|
||||
|
||||
let value = execute(args, &adapter, &CommandContext::default().with_headed(true)).unwrap();
|
||||
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ fn positive_timeout_uses_stable_post_focus_drag_bounds() {
|
|||
height: 60.0,
|
||||
});
|
||||
let mut args = cross_app_args(snapshot_id);
|
||||
args.timeout_ms = Some(500);
|
||||
args.timeout_ms = Some(5_000);
|
||||
|
||||
let value = execute(args, &adapter, &CommandContext::default().with_headed(true)).unwrap();
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ fn headed_hover_retries_transient_post_focus_occlusion_without_holding_lease() {
|
|||
lease_held: std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||
};
|
||||
let mut args = ref_args(snapshot_id);
|
||||
args.timeout_ms = Some(500);
|
||||
args.timeout_ms = Some(5_000);
|
||||
|
||||
let value = execute(args, &adapter, &CommandContext::default().with_headed(true)).unwrap();
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ fn positive_timeout_uses_stable_post_focus_hover_bounds() {
|
|||
height: 10.0,
|
||||
});
|
||||
let mut args = ref_args(snapshot_id);
|
||||
args.timeout_ms = Some(500);
|
||||
args.timeout_ms = Some(5_000);
|
||||
|
||||
let value = execute(args, &adapter, &CommandContext::default().with_headed(true)).unwrap();
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ fn terminal_stale_ref_is_preserved_after_retry_budget_expires() {
|
|||
let adapter = TerminalAfterRetryAdapter {
|
||||
bounds_reads: AtomicU32::new(0),
|
||||
};
|
||||
let deadline = crate::Deadline::after(100).unwrap();
|
||||
let deadline = crate::Deadline::after(5_000).unwrap();
|
||||
|
||||
let err = match wait_for_point_with_deadline(
|
||||
point_args(&snapshot_id),
|
||||
|
|
@ -197,7 +197,7 @@ fn explicitly_retryable_app_unresponsive_recovers_within_shared_deadline() {
|
|||
let adapter = UnresponsiveThenReadyAdapter {
|
||||
resolve_calls: AtomicU32::new(0),
|
||||
};
|
||||
let deadline = crate::Deadline::after(1_000).unwrap();
|
||||
let deadline = crate::Deadline::after(5_000).unwrap();
|
||||
|
||||
let resolved = wait_for_point_with_deadline(
|
||||
point_args(&snapshot_id),
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ fn hydration_retry_preserves_failed_attempt_statistics() {
|
|||
};
|
||||
let request = LocatorResolveRequest {
|
||||
selection: LocatorSelection::Strict,
|
||||
deadline: crate::Deadline::after(1_000).unwrap(),
|
||||
deadline: crate::Deadline::after(5_000).unwrap(),
|
||||
max_raw_depth: 10,
|
||||
materialization: LocatorMaterialization::SelectedMatches,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ fn role_query(role: &str) -> LocatorQuery {
|
|||
fn selected_request() -> LocatorResolveRequest {
|
||||
LocatorResolveRequest {
|
||||
selection: LocatorSelection::First,
|
||||
deadline: crate::Deadline::after(500).unwrap(),
|
||||
deadline: crate::Deadline::after(5_000).unwrap(),
|
||||
max_raw_depth: 50,
|
||||
materialization: LocatorMaterialization::SelectedMatches,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ fn role_query() -> LocatorQuery {
|
|||
fn selected_request() -> LocatorResolveRequest {
|
||||
LocatorResolveRequest {
|
||||
selection: LocatorSelection::First,
|
||||
deadline: crate::Deadline::after(500).unwrap(),
|
||||
deadline: crate::Deadline::after(5_000).unwrap(),
|
||||
max_raw_depth: 50,
|
||||
materialization: LocatorMaterialization::SelectedMatches,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ fn containment(positive: bool) -> ContainmentPredicate {
|
|||
fn request() -> LocatorResolveRequest {
|
||||
LocatorResolveRequest {
|
||||
selection: LocatorSelection::First,
|
||||
deadline: crate::Deadline::after(500).unwrap(),
|
||||
deadline: crate::Deadline::after(5_000).unwrap(),
|
||||
max_raw_depth: 10,
|
||||
materialization: LocatorMaterialization::SelectedMatches,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ fn zero_timeout_is_an_explicit_single_attempt() {
|
|||
#[test]
|
||||
fn ambiguity_diagnostic_preserves_adapter_result_details() {
|
||||
let adapter = DispatchGuardAdapter::new("ambiguous", 0);
|
||||
let result = execute(&adapter, 500).unwrap();
|
||||
let result = execute(&adapter, 5_000).unwrap();
|
||||
assert_eq!(result.details.as_ref().unwrap()["mechanism"], "AXPress");
|
||||
assert_eq!(
|
||||
result.details.as_ref().unwrap()["transient_ambiguity"],
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ fn auto_wait_retries_a_transiently_unresponsive_accessibility_service() {
|
|||
ref_id: "@e1",
|
||||
context: &CommandContext::default(),
|
||||
},
|
||||
ActionRequest::headless(Action::Click).with_timeout_ms(Some(1_000)),
|
||||
ActionRequest::headless(Action::Click).with_timeout_ms(Some(5_000)),
|
||||
crate::ref_action::dispatch_resolved,
|
||||
)
|
||||
.unwrap();
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ fn activation_lease_is_dropped_before_observation_retry() {
|
|||
bounds: None,
|
||||
state: Default::default(),
|
||||
};
|
||||
let deadline = crate::Deadline::after(500).unwrap();
|
||||
let deadline = crate::Deadline::after(5_000).unwrap();
|
||||
let request = ObservationRequest::snapshot(&crate::TreeOptions::default(), deadline)
|
||||
.validate()
|
||||
.unwrap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue