Integrate release recovery, semantic review, coverage and Windows packaging
This commit is contained in:
@@ -12,7 +12,7 @@ use std::{
|
||||
};
|
||||
use tokio::{
|
||||
io::{AsyncReadExt, AsyncWriteExt},
|
||||
sync::oneshot,
|
||||
sync::{oneshot, watch},
|
||||
task::JoinHandle,
|
||||
};
|
||||
|
||||
@@ -500,13 +500,19 @@ async fn hosted_response_limits_cover_declared_and_chunked_bodies() {
|
||||
async fn hosted_timeout_and_disconnect_leave_mutation_outcomes_explicit() {
|
||||
let received = Arc::new(AtomicUsize::new(0));
|
||||
let calls = Arc::clone(&received);
|
||||
let (release, held) = watch::channel(false);
|
||||
let server = TestServer::fixture(Router::new().route(
|
||||
"/api/v1/projects/import-source-project",
|
||||
post(move || {
|
||||
let calls = Arc::clone(&calls);
|
||||
let mut held = held.clone();
|
||||
async move {
|
||||
calls.fetch_add(1, Ordering::SeqCst);
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
// Never race a fixed response delay against the client deadline.
|
||||
// A retained watch value also releases a handler admitted late.
|
||||
while !*held.borrow_and_update() {
|
||||
held.changed().await.unwrap();
|
||||
}
|
||||
StatusCode::CREATED
|
||||
}
|
||||
}),
|
||||
@@ -518,9 +524,14 @@ async fn hosted_timeout_and_disconnect_leave_mutation_outcomes_explicit() {
|
||||
let failure = client.publish(authored()).await.unwrap_err();
|
||||
assert_eq!(failure.code, "timeout");
|
||||
assert!(failure.uncertain);
|
||||
assert_eq!(received.load(Ordering::SeqCst), 1);
|
||||
release.send(true).unwrap();
|
||||
let base = server.base.clone();
|
||||
server.finish().await;
|
||||
// Under executor/CPU contention, the deadline can expire before admission.
|
||||
// Both zero and one admission have an uncertain mutation outcome; neither
|
||||
// permits a retry. The lost-response test above independently reads a full
|
||||
// admitted request and requires exactly one publication.
|
||||
assert!(received.load(Ordering::SeqCst) <= 1);
|
||||
let failure = Connection::with_timeout(&base, Secret::default(), Duration::from_secs(2))
|
||||
.unwrap()
|
||||
.catalog("", None)
|
||||
|
||||
Reference in New Issue
Block a user