Skip to content

Commit

Permalink
fix: build release warning (#13954)
Browse files Browse the repository at this point in the history
  • Loading branch information
xudong963 authored Dec 7, 2023
1 parent 47014c8 commit a9f449e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/query/ee/src/test_kits/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ impl TestFixture {
set_panic_hook();
std::env::set_var("UNIT_TEST", "TRUE");

let thread_name = std::thread::current().name().unwrap().to_string();

#[cfg(debug_assertions)]
common_base::base::GlobalInstance::init_testing(&thread_name);
{
let thread_name = std::thread::current().name().unwrap().to_string();
common_base::base::GlobalInstance::init_testing(&thread_name);
}

GlobalServices::init_with(config).await?;
MockServices::init(config, public_key).await?;
Expand Down
14 changes: 9 additions & 5 deletions src/query/service/src/test_kits/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,21 @@ pub struct TestFixture {
}

pub struct TestGuard {
thread_name: String,
_thread_name: String,
}

impl TestGuard {
pub fn new(thread_name: String) -> Self {
Self { thread_name }
Self {
_thread_name: thread_name,
}
}
}

impl Drop for TestGuard {
fn drop(&mut self) {
#[cfg(debug_assertions)]
common_base::base::GlobalInstance::drop_testing(&self.thread_name);
common_base::base::GlobalInstance::drop_testing(&self._thread_name);
}
}

Expand Down Expand Up @@ -200,9 +202,11 @@ impl TestFixture {
set_panic_hook();
std::env::set_var("UNIT_TEST", "TRUE");

let thread_name = std::thread::current().name().unwrap().to_string();
#[cfg(debug_assertions)]
common_base::base::GlobalInstance::init_testing(&thread_name);
{
let thread_name = std::thread::current().name().unwrap().to_string();
common_base::base::GlobalInstance::init_testing(&thread_name);
}

GlobalServices::init_with(config).await?;
OssLicenseManager::init(config.query.tenant_id.clone())?;
Expand Down

0 comments on commit a9f449e

Please sign in to comment.