Skip to content

Commit c1a20d7

Browse files
authored
Merge pull request #9225 from Xuanwo/bump-opendal
feat: Bump opendal to fix aws IMDSv2 credential
2 parents b5ba4a9 + 96237f1 commit c1a20d7

File tree

6 files changed

+60
-70
lines changed

6 files changed

+60
-70
lines changed

.github/actions/test_unit/action.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,11 @@ runs:
1414
bypass_env_vars: RUSTFLAGS,RUSTDOCFLAGS,RUST_TEST_THREADS,RUST_LOG,RUST_BACKTRACE
1515

1616
- shell: bash
17-
run: cargo -Z sparse-registry test --no-fail-fast
17+
run: cargo -Z sparse-registry test
1818
env:
1919
RUST_TEST_THREADS: "2"
20-
RUST_LOG: ERROR
20+
RUST_LOG: DEBUG
2121
RUST_BACKTRACE: full
22-
# RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests --cfg tokio_unstable'
23-
# RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
24-
25-
# Temporarily disable test coverage checks to save CI resources.
26-
# The main purpose is to avoid OOM due to build for specific target.
27-
#
28-
# Instructions
29-
# - `uncomment/enable`: If we self-host the CI or split the repo (especially, common-functions) to a finer granularity.
30-
# - `remove`: If we lack the need for test coverage, or adopt a new solution.
31-
32-
# - name: Install grcov
33-
# uses: actions-rs/cargo@v1
34-
# with:
35-
# command: install
36-
# args: grcov
37-
38-
# - name: Run code coverage
39-
# uses: actions-rs/grcov@v0.1.5
40-
# id: coverage
41-
42-
# - name: Upload to codecov.io
43-
# uses: codecov/codecov-action@v1
44-
# with:
45-
# token: ${{ inputs.codecov_token }}
46-
# file: ${{ steps.coverage.outputs.report }}
4722

4823
- name: Upload failure
4924
if: failure()

Cargo.lock

Lines changed: 32 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/query/catalog/src/table_context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ use crate::plan::PartInfoPtr;
3636
use crate::plan::Partitions;
3737
use crate::table::Table;
3838

39+
#[derive(Debug)]
3940
pub struct ProcessInfo {
4041
pub id: String,
4142
pub typ: String,

src/query/service/tests/it/servers/http/http_query_handlers.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ async fn test_pagination() -> Result<()> {
422422
Ok(())
423423
}
424424

425-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
425+
#[tokio::test(flavor = "current_thread")]
426426
async fn test_http_session() -> Result<()> {
427427
let _guard = TestGlobalServices::setup(ConfigBuilder::create().build()).await?;
428428

@@ -768,7 +768,7 @@ async fn post_json_to_endpoint(
768768
check_response(response).await
769769
}
770770

771-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
771+
#[tokio::test(flavor = "current_thread")]
772772
async fn test_auth_jwt() -> Result<()> {
773773
let user_name = "root";
774774

@@ -897,7 +897,7 @@ async fn assert_auth_current_role(
897897
Ok(())
898898
}
899899

900-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
900+
#[tokio::test(flavor = "current_thread")]
901901
async fn test_auth_jwt_with_create_user() -> Result<()> {
902902
let user_name = "user1";
903903

@@ -1002,7 +1002,7 @@ async fn test_http_handler_tls_server() -> Result<()> {
10021002
Ok(())
10031003
}
10041004

1005-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
1005+
#[tokio::test(flavor = "current_thread")]
10061006
async fn test_http_handler_tls_server_failed_case_1() -> Result<()> {
10071007
let config = ConfigBuilder::create()
10081008
.http_handler_tls_server_key(TEST_SERVER_KEY)
@@ -1074,7 +1074,7 @@ async fn test_http_service_tls_server_mutual_tls() -> Result<()> {
10741074
}
10751075

10761076
// cannot connect with server unless it have CA signed identity
1077-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
1077+
#[tokio::test(flavor = "current_thread")]
10781078
async fn test_http_service_tls_server_mutual_tls_failed() -> Result<()> {
10791079
let _guard = TestGlobalServices::setup(
10801080
ConfigBuilder::create()
@@ -1470,7 +1470,7 @@ async fn test_affect() -> Result<()> {
14701470
Ok(())
14711471
}
14721472

1473-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
1473+
#[tokio::test(flavor = "current_thread")]
14741474
async fn test_auth_configured_user() -> Result<()> {
14751475
let user_name = "conf_user";
14761476
let pass_word = "conf_user_pwd";

src/query/service/tests/it/tests/sessions.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use std::time::Duration;
16-
1715
use common_base::base::GlobalInstance;
1816
use common_config::Config;
1917
use common_exception::Result;
2018
use common_tracing::set_panic_hook;
2119
use databend_query::clusters::ClusterDiscovery;
2220
use databend_query::sessions::SessionManager;
2321
use databend_query::GlobalServices;
24-
use time::Instant;
22+
use tracing::debug;
2523
use tracing::info;
2624

2725
pub struct TestGlobalServices;
@@ -63,16 +61,26 @@ pub struct TestGuard {
6361

6462
impl Drop for TestGuard {
6563
fn drop(&mut self) {
66-
// Hack: The session may be referenced by other threads. Let's try to wait.
67-
let now = Instant::now();
68-
while !SessionManager::instance().processes_info().is_empty() {
69-
std::thread::sleep(Duration::from_millis(500));
64+
debug!(
65+
"test {} is finished, starting dropping all resources",
66+
&self.thread_name
67+
);
7068

71-
if now.elapsed() > Duration::from_secs(3) {
72-
break;
69+
// Check if session manager sill have active sessions.
70+
{
71+
let session_mgr = SessionManager::instance();
72+
// Destory all sessions.
73+
for process in session_mgr.processes_info() {
74+
session_mgr.destroy_session(&process.id);
75+
}
76+
// Double check again.
77+
for process in session_mgr.processes_info() {
78+
debug!("process {process:?} still running after drop, something must be wrong");
7379
}
7480
}
7581

76-
GlobalInstance::drop_testing(&self.thread_name)
82+
GlobalInstance::drop_testing(&self.thread_name);
83+
84+
debug!("test {} resources have been dropped", &self.thread_name);
7785
}
7886
}

src/query/settings/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub struct SettingValue {
6363
possible_values: Option<Vec<&'static str>>,
6464
}
6565

66-
#[derive(Clone)]
66+
#[derive(Clone, Debug)]
6767
pub struct Settings {
6868
settings: Arc<DashMap<String, SettingValue>>,
6969
// TODO verify this, will tenant change during the lifetime of a given session?

0 commit comments

Comments
 (0)