Skip to content

Commit

Permalink
chore(query): disable trace in mysql handler unit test (#13389)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhang2014 authored Oct 23, 2023
1 parent e097c0f commit 90c7c2e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/query/service/src/test_kits/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ impl ConfigBuilder {
self
}

pub fn disable_trace(mut self) -> ConfigBuilder {
self.conf.log.tracing.on = false;
self
}

pub fn build(self) -> InnerConfig {
self.conf
}
Expand Down
22 changes: 16 additions & 6 deletions src/query/service/tests/it/servers/mysql/mysql_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use crate::tests::tls_constants::*;
#[tokio::test(flavor = "current_thread")]
async fn test_generic_code_with_on_query() -> Result<()> {
// Setup
let _guard = TestGlobalServices::setup(ConfigBuilder::create().build()).await?;
let _guard = TestGlobalServices::setup(ConfigBuilder::create().disable_trace().build()).await?;

let tcp_keepalive_timeout_secs = 120;
let mut handler = MySQLHandler::create(tcp_keepalive_timeout_secs, MySQLTlsConfig::default())?;
Expand All @@ -57,7 +57,7 @@ async fn test_generic_code_with_on_query() -> Result<()> {
#[tokio::test(flavor = "current_thread")]
async fn test_connect_with_tls() -> Result<()> {
// Setup
let _guard = TestGlobalServices::setup(ConfigBuilder::create().build()).await?;
let _guard = TestGlobalServices::setup(ConfigBuilder::create().disable_trace().build()).await?;

let tcp_keepalive_timeout_secs = 120;
let tls_config = MySQLTlsConfig::new(TEST_SERVER_CERT.to_string(), TEST_SERVER_KEY.to_string());
Expand All @@ -76,8 +76,13 @@ async fn test_connect_with_tls() -> Result<()> {

#[tokio::test(flavor = "current_thread")]
async fn test_rejected_session_with_sequence() -> Result<()> {
let _guard =
TestGlobalServices::setup(ConfigBuilder::create().max_active_sessions(1).build()).await?;
let _guard = TestGlobalServices::setup(
ConfigBuilder::create()
.disable_trace()
.max_active_sessions(1)
.build(),
)
.await?;

let tcp_keepalive_timeout_secs = 120;
let mut handler = MySQLHandler::create(tcp_keepalive_timeout_secs, MySQLTlsConfig::default())?;
Expand Down Expand Up @@ -143,8 +148,13 @@ async fn test_rejected_session_with_parallel() -> Result<()> {
}

// Setup
let _guard =
TestGlobalServices::setup(ConfigBuilder::create().max_active_sessions(1).build()).await?;
let _guard = TestGlobalServices::setup(
ConfigBuilder::create()
.disable_trace()
.max_active_sessions(1)
.build(),
)
.await?;

let tcp_keepalive_timeout_secs = 120;
let mut handler = MySQLHandler::create(tcp_keepalive_timeout_secs, MySQLTlsConfig::default())?;
Expand Down

1 comment on commit 90c7c2e

@vercel
Copy link

@vercel vercel bot commented on 90c7c2e Oct 23, 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.