feat: remove retrieval batch over HTTP
This commit is contained in:
@@ -16,7 +16,7 @@ use wip_protocol::{
|
||||
};
|
||||
|
||||
fn limits() -> Limits {
|
||||
Limits::new(64 * 1024, 64 * 1024, 64, 64).unwrap()
|
||||
Limits::new(64 * 1024, 64 * 1024, 64).unwrap()
|
||||
}
|
||||
|
||||
fn setup() -> (Client, wip_client::SessionId) {
|
||||
|
||||
@@ -17,7 +17,7 @@ use wip_protocol::{
|
||||
};
|
||||
|
||||
fn wire_limits() -> Limits {
|
||||
Limits::new(64 * 1024, 64 * 1024, 64, 64).unwrap()
|
||||
Limits::new(64 * 1024, 64 * 1024, 64).unwrap()
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -399,6 +399,67 @@ fn ensure_interface_waits_for_request_and_cache_capacity_without_evicting() {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn independent_retrievals_run_concurrently_and_complete_out_of_order() {
|
||||
let mut client = client(8, 8, 8, 8);
|
||||
let session = client
|
||||
.open_session("https://example.test/wip", SecurityContext::new("subject"))
|
||||
.unwrap();
|
||||
|
||||
let first = client.refresh_observed(&session, "/one", 0).unwrap();
|
||||
let second = client.refresh_observed(&session, "/two", 0).unwrap();
|
||||
let interface = client.prepare_interface(&session, "math").unwrap();
|
||||
|
||||
assert_eq!(first.request.uri().path(), "/wip/v1/observe");
|
||||
assert_eq!(second.request.uri().path(), "/wip/v1/observe");
|
||||
assert_eq!(interface.request.uri().path(), "/wip/v1/fetch_interface");
|
||||
assert_eq!(client.in_flight_len(), 3);
|
||||
|
||||
client
|
||||
.complete(
|
||||
second.id,
|
||||
observation_response("/two", &object("two", None, b"two")),
|
||||
)
|
||||
.unwrap();
|
||||
client
|
||||
.complete(
|
||||
interface.id,
|
||||
encode_fetch_interface_response(
|
||||
&FetchInterfaceRequest {
|
||||
interface: "math".into(),
|
||||
},
|
||||
&FetchInterfaceResponse {
|
||||
interface: "math".into(),
|
||||
descriptor: descriptor(TypeExpr::Integer),
|
||||
validator: Some(b"math-v1".to_vec()),
|
||||
},
|
||||
wire_limits(),
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
client
|
||||
.complete(
|
||||
first.id,
|
||||
observation_response("/one", &object("one", None, b"one")),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
client.object(&session, "/one").unwrap().state,
|
||||
ObservationState::Fresh
|
||||
);
|
||||
assert_eq!(
|
||||
client.object(&session, "/two").unwrap().state,
|
||||
ObservationState::Fresh
|
||||
);
|
||||
assert_eq!(
|
||||
client.interface(&session, "math").unwrap().state,
|
||||
ObservationState::Fresh
|
||||
);
|
||||
assert_eq!(client.in_flight_len(), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn newer_refresh_rejects_out_of_order_response_for_the_same_subject() {
|
||||
let mut client = client(8, 8, 8, 8);
|
||||
|
||||
Reference in New Issue
Block a user