mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-15 16:32:34 +00:00
test: only assert genuinely invalid read-preference values at request ingresses (#9576)
The flow and nested-MergeScan ingress tests hardcoded "follower" among the read-preference values that must be rejected, coupling them to the current leader-only ReadPreference enum. Assert only genuinely invalid values there, matching the wire-values test which already limits itself to ["", "unknown"]. This keeps the ingress tests valid for builds that extend ReadPreference with more variants. Signed-off-by: Ning Sun <sunning@greptime.com>
This commit is contained in:
@@ -1170,7 +1170,7 @@ mod tests {
|
||||
response.unwrap_err().status_code()
|
||||
);
|
||||
|
||||
for value in ["", "unknown", "follower"] {
|
||||
for value in ["", "unknown"] {
|
||||
let mut query_context =
|
||||
api::v1::QueryContext::from(session::context::QueryContext::arc().as_ref());
|
||||
query_context.extensions.insert(
|
||||
|
||||
@@ -158,7 +158,7 @@ async fn test_nested_merge_scan_capability_rejects_internal_read_preference() {
|
||||
.map(|id| (*id, rpc_requests(&cluster, *id)))
|
||||
.collect::<BTreeMap<_, _>>();
|
||||
|
||||
for value in ["", "invalid", "follower"] {
|
||||
for value in ["", "invalid"] {
|
||||
let mut header = region_request_header(&query_ctx);
|
||||
header
|
||||
.query_context
|
||||
|
||||
Reference in New Issue
Block a user