mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-07-12 03:12:11 +02:00
This reverts commitb352fca13c, reversing changes made to748ad334a9.
This commit is contained in:
parent
b352fca13c
commit
7310f69928
5 changed files with 0 additions and 142 deletions
|
|
@ -675,85 +675,6 @@ async fn healthz_succeeds_after_startup() {
|
|||
}
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn request_id_minted_when_absent() {
|
||||
let (_temp, app) = app_for_loaded_repo().await;
|
||||
let response = app
|
||||
.clone()
|
||||
.oneshot(
|
||||
Request::builder()
|
||||
.uri("/healthz")
|
||||
.method(Method::GET)
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
let id = response
|
||||
.headers()
|
||||
.get("x-request-id")
|
||||
.expect("X-Request-Id missing")
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.to_owned();
|
||||
// ULIDs are 26 chars Crockford base32.
|
||||
assert_eq!(id.len(), 26);
|
||||
assert!(id.chars().all(|c| c.is_ascii_alphanumeric()));
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn request_id_echoed_when_caller_supplies_valid_value() {
|
||||
let (_temp, app) = app_for_loaded_repo().await;
|
||||
let response = app
|
||||
.clone()
|
||||
.oneshot(
|
||||
Request::builder()
|
||||
.uri("/healthz")
|
||||
.method(Method::GET)
|
||||
.header("X-Request-Id", "trace-abc123")
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response
|
||||
.headers()
|
||||
.get("x-request-id")
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.unwrap(),
|
||||
"trace-abc123"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn request_id_minted_when_caller_supplies_invalid_value() {
|
||||
let (_temp, app) = app_for_loaded_repo().await;
|
||||
// 200-char string is a valid HeaderValue but exceeds the inbound length cap.
|
||||
let too_long = "a".repeat(200);
|
||||
let response = app
|
||||
.clone()
|
||||
.oneshot(
|
||||
Request::builder()
|
||||
.uri("/healthz")
|
||||
.method(Method::GET)
|
||||
.header("X-Request-Id", &too_long)
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
let id = response
|
||||
.headers()
|
||||
.get("x-request-id")
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.unwrap();
|
||||
assert_ne!(id, too_long);
|
||||
assert_eq!(id.len(), 26);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn schema_drift_returns_conflict_for_snapshot_read_and_change() {
|
||||
let (temp, app) = app_for_loaded_repo().await;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue