File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ use common_meta_app::schema::DatabaseMeta;
20
20
use common_meta_app:: schema:: DatabaseNameIdent ;
21
21
use common_meta_app:: schema:: TableNameIdent ;
22
22
use common_meta_app:: share:: * ;
23
+ use common_meta_types:: anyerror:: AnyError ;
23
24
use common_meta_types:: app_error:: AppError ;
24
25
use common_meta_types:: app_error:: ShareHasNoGrantedDatabase ;
25
26
use common_meta_types:: app_error:: UnknownDatabase ;
@@ -486,6 +487,7 @@ where
486
487
}
487
488
488
489
/// Get existing value by key. Panic if key is absent.
490
+ /// This function is only used for testing.
489
491
pub async fn get_kv_data < T > (
490
492
kv_api : & ( impl KVApi + ?Sized ) ,
491
493
key : & impl KVApiKey ,
@@ -500,7 +502,10 @@ where
500
502
return Ok ( s) ;
501
503
} ;
502
504
503
- unreachable ! ( "failed to get {}" , key. to_key( ) )
505
+ Err ( MetaError :: Fatal ( AnyError :: error ( format ! (
506
+ "failed to get {}" ,
507
+ key. to_key( )
508
+ ) ) ) )
504
509
}
505
510
506
511
pub async fn get_object_shared_by_share_ids (
Original file line number Diff line number Diff line change @@ -2374,11 +2374,13 @@ impl SchemaApiTestSuite {
2374
2374
for db_id in old_id_list. iter ( ) {
2375
2375
let id_key = DatabaseId { db_id : * db_id } ;
2376
2376
let id_mapping = DatabaseIdToName { db_id : * db_id } ;
2377
+
2377
2378
let meta_res: Result < DatabaseMeta , MetaError > =
2378
2379
get_kv_data ( mt. as_kv_api ( ) , & id_key) . await ;
2380
+ assert ! ( meta_res. is_err( ) ) ;
2381
+
2379
2382
let mapping_res: Result < DatabaseNameIdent , MetaError > =
2380
2383
get_kv_data ( mt. as_kv_api ( ) , & id_mapping) . await ;
2381
- assert ! ( meta_res. is_err( ) ) ;
2382
2384
assert ! ( mapping_res. is_err( ) ) ;
2383
2385
}
2384
2386
You can’t perform that action at this time.
0 commit comments