Skip to content

Commit c836955

Browse files
committed
Test for presence of QUERY_TIME_HEADER in uncached read response
1 parent d71d738 commit c836955

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/frontend/http.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ pub mod tests {
624624
use crate::testutils::schema_from_header;
625625
use crate::{
626626
context::{test_utils::in_memory_context, DefaultSeafowlContext, SeafowlContext},
627-
frontend::http::{filters, QUERY_HEADER},
627+
frontend::http::{filters, QUERY_HEADER, QUERY_TIME_HEADER},
628628
};
629629

630630
fn http_config_from_access_policy_and_cache_control(
@@ -1589,4 +1589,17 @@ SELECT
15891589
)
15901590
);
15911591
}
1592+
1593+
#[rstest]
1594+
#[tokio::test]
1595+
async fn test_get_uncached_read_query_timing_header_present(
1596+
#[values(None, Some("test_db"))] new_db: Option<&str>,
1597+
) {
1598+
let context = in_memory_context_with_single_table(new_db).await;
1599+
let handler = filters(context, http_config_from_access_policy(free_for_all()));
1600+
1601+
let resp = query_uncached_endpoint(&handler, SELECT_QUERY, new_db, None).await;
1602+
1603+
assert!(resp.headers().contains_key(QUERY_TIME_HEADER));
1604+
}
15921605
}

0 commit comments

Comments
 (0)