fix: resolve concurrency hardening lint failures

Use typed connection admission errors, group HTTP limits, and make test lock lifetimes explicit. Handle fixture reads and remove unnecessary cloning and manual divisibility checks.
This commit is contained in:
elky
2026-09-10 08:31:47 +08:00
parent 3a8dadcd6b
commit 6aeadcd1d7
8 changed files with 82 additions and 67 deletions
@@ -173,7 +173,10 @@ async fn assert_transfer_source_unchanged(
source: &str,
entry: &RuntimeQueueEntry,
) {
assert_eq!(transfer_entries(admin, source).await, [entry.clone()]);
assert_eq!(
transfer_entries(admin, source).await.as_slice(),
std::slice::from_ref(&entry)
);
let pending = transfer_pending(admin, source).await;
assert_eq!(pending.len(), 1);
assert_eq!(pending[0].0, entry.id);
@@ -100,7 +100,7 @@ async fn copy_and_commit(
if plan.first() != Some(&2) {
return Ok(Some((plan, false)));
}
if plan.len() < 4 || (plan.len() - 1) % 3 != 0 {
if plan.len() < 4 || !(plan.len() - 1).is_multiple_of(3) {
return Err(DataLayerError::UnexpectedValue(
"invalid usage window copy plan".to_string(),
));