Skip to content

Commit

Permalink
refactor: creating 30,000 tables may timeout unit test, reduce it to …
Browse files Browse the repository at this point in the history
…DEFAULT_MGET_SIZE+20 (#13147)
  • Loading branch information
drmingdrmer authored Oct 9, 2023
1 parent 5f4c294 commit 8ef0939
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/meta/api/src/schema_api_test_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ use crate::testing::get_kv_data;
use crate::DatamaskApi;
use crate::SchemaApi;
use crate::ShareApi;
use crate::DEFAULT_MGET_SIZE;

/// Test suite of `SchemaApi`.
///
Expand Down Expand Up @@ -286,7 +287,7 @@ impl SchemaApiTestSuite {
suite.table_update_mask_policy(&b.build().await).await?;
suite.table_upsert_option(&b.build().await).await?;
suite.table_list(&b.build().await).await?;
suite.table_list_30_000(&b.build().await).await?;
suite.table_list_many(&b.build().await).await?;
suite.table_list_all(&b.build().await).await?;
suite
.table_drop_undrop_list_history(&b.build().await)
Expand Down Expand Up @@ -4733,11 +4734,12 @@ impl SchemaApiTestSuite {
Ok(())
}

/// Test listing 30,000 tables
/// Test listing many tables that exceeds default mget chunk size.
#[minitrace::trace]
async fn table_list_30_000<MT>(&self, mt: &MT) -> anyhow::Result<()>
async fn table_list_many<MT>(&self, mt: &MT) -> anyhow::Result<()>
where MT: SchemaApi + kvapi::AsKVApi<Error = MetaError> {
let n = 30_000;
// Create tables that exceeds the default mget chunk size
let n = DEFAULT_MGET_SIZE + 20;

let mut util = Util::new(mt, "tenant1", "db1", "tb1", "eng1");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ async fn test_meta_embedded_single() -> anyhow::Result<()> {

SchemaApiTestSuite::test_single_node(builder.clone()).await?;
ShareApiTestSuite::test_single_node_share(builder.clone()).await?;
BackgroundApiTestSuite::test_single_node(builder).await
BackgroundApiTestSuite::test_single_node(builder).await?;

Ok(())
}

1 comment on commit 8ef0939

@vercel
Copy link

@vercel vercel bot commented on 8ef0939 Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.