0.34.6_repo_cleanup
This commit is contained in:
1 parent
ce1a90397c
commit
133d2f0f91
273 files changed
+5969
-6926
No files matched your search
+21
-11
@@ -66,7 +66,7 @@ mod tests {
|
||||
defaults.health_check_enabled = false;
|
||||
assert_eq!(settings.health_for(&defaults).mode, HealthMode::Off);
|
||||
assert!(!settings.passive_for(&defaults).enabled);
|
||||
assert!(!defaults.pool_eligible); // routing intent is independent
|
||||
assert!(!defaults.pool_eligible);
|
||||
defaults.health_check_enabled = true;
|
||||
defaults.health_check = Some(HealthCheck {
|
||||
mode: HealthMode::Http,
|
||||
@@ -105,7 +105,8 @@ mod tests {
|
||||
assert_eq!(parsed.keepalive.max_idle_per_host, 64);
|
||||
let explicit: Settings = serde_json::from_value(serde_json::json!({
|
||||
"keepalive": { "max_idle_per_host": 4 }
|
||||
})).unwrap();
|
||||
}))
|
||||
.unwrap();
|
||||
assert_eq!(explicit.keepalive.max_idle_per_host, 4);
|
||||
assert_eq!(parsed.keepalive.pool_recycle_requests, 25_000);
|
||||
assert_eq!(parsed.keepalive.pool_recycle_seconds, 3_600);
|
||||
@@ -356,7 +357,7 @@ mod tests {
|
||||
}
|
||||
assert_eq!(counts, [30, 10]);
|
||||
assert_eq!(pool.members[0].state.active.load(Ordering::Relaxed), 0);
|
||||
assert_eq!(pool.members[0].state.requests.load(Ordering::Relaxed), 0); // Mere cache selection isn't origin traffic.
|
||||
assert_eq!(pool.members[0].state.requests.load(Ordering::Relaxed), 0);
|
||||
}
|
||||
#[tokio::test]
|
||||
async fn least_connections_counts_a_lease_until_its_last_owner_drops() {
|
||||
@@ -769,7 +770,6 @@ mod tests {
|
||||
assert!(state.healthy());
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn single_backend_fast_path_observes_capacity_and_health_without_affinity_cookie() {
|
||||
let pool = capacity_pool(1, 0);
|
||||
@@ -792,7 +792,10 @@ mod tests {
|
||||
let first = select(&pool);
|
||||
let second = select(&pool);
|
||||
assert!(Arc::ptr_eq(&first.lease.health, &second.lease.health));
|
||||
assert!(Arc::ptr_eq(&first.lease.passive_health, &second.lease.passive_health));
|
||||
assert!(Arc::ptr_eq(
|
||||
&first.lease.passive_health,
|
||||
&second.lease.passive_health
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -800,10 +803,14 @@ mod tests {
|
||||
let state = BackendState::new(HealthMode::Off);
|
||||
assert!(state.healthy());
|
||||
let active = settings(HealthMode::Off);
|
||||
let passive = PassiveHealth { enabled: true, fall: Some(1), rise: Some(1), ..Default::default() };
|
||||
let passive = PassiveHealth {
|
||||
enabled: true,
|
||||
fall: Some(1),
|
||||
rise: Some(1),
|
||||
..Default::default()
|
||||
};
|
||||
state.observe_passive(&active, &passive, "connect_error", Duration::from_millis(2));
|
||||
assert!(!state.healthy());
|
||||
// Preserve quarantine rules; an active probe is not invented here.
|
||||
state.observe_passive(&active, &passive, "ok", Duration::from_millis(2));
|
||||
assert!(state.healthy());
|
||||
}
|
||||
@@ -812,14 +819,17 @@ mod tests {
|
||||
fn successful_lease_response_keeps_passive_observability_and_failure_detail() {
|
||||
let pool = capacity_pool(0, 0);
|
||||
let selection = select(&pool);
|
||||
selection.lease.response(200, Duration::from_millis(5), true);
|
||||
selection
|
||||
.lease
|
||||
.response(200, Duration::from_millis(5), true);
|
||||
let state = &selection.lease.member.state;
|
||||
assert_eq!(state.last_status.load(Ordering::Relaxed), 200);
|
||||
assert_eq!(lock(&state.health).passive_result, "ok");
|
||||
assert!(lock(&state.health).latency_us > 0);
|
||||
selection.lease.response(503, Duration::from_millis(5), true);
|
||||
selection
|
||||
.lease
|
||||
.response(503, Duration::from_millis(5), true);
|
||||
assert_eq!(state.last_status.load(Ordering::Relaxed), 503);
|
||||
assert_eq!(lock(&state.last_failure).detail, "status=503");
|
||||
}
|
||||
|
||||
} // mod tests
|
||||
}
|
||||
Reference in new issue
Block a user