test(router): service limit error messages

Assert the user-facing service limit error messages.
pull/24376/head
Dom Dwyer 2023-02-06 17:43:37 +01:00
parent 114bafe9a1
commit 3881e11734
No known key found for this signature in database
GPG Key ID: E4C40DBD9157879A
1 changed files with 25 additions and 1 deletions

View File

@ -560,7 +560,10 @@ where
mod tests {
use super::*;
use crate::{
dml_handlers::mock::{MockDmlHandler, MockDmlHandlerCall},
dml_handlers::{
mock::{MockDmlHandler, MockDmlHandlerCall},
CachedServiceProtectionLimit,
},
namespace_resolver::{mock::MockNamespaceResolver, NamespaceCreationError},
};
use assert_matches::assert_matches;
@ -1527,5 +1530,26 @@ mod tests {
RequestLimit,
"this service is overloaded, please try again later",
),
(
DmlHandler(DmlError::Schema(SchemaError::ServiceLimit(Box::new(CachedServiceProtectionLimit::Column {
table_name: "bananas".to_string(),
existing_column_count: 42,
merged_column_count: 4242,
max_columns_per_table: 24,
})))),
"dml handler error: service limit reached: couldn't create columns in table `bananas`; table contains 42 \
existing columns, applying this write would result in 4242 columns, limit is 24",
),
(
DmlHandler(DmlError::Schema(SchemaError::ServiceLimit(Box::new(CachedServiceProtectionLimit::Table {
existing_table_count: 42,
merged_table_count: 4242,
table_count_limit: 24,
})))),
"dml handler error: service limit reached: couldn't create new table; namespace contains 42 existing \
tables, applying this write would result in 4242 columns, limit is 24",
),
}
}