Skip to content

Commit f2d58a7

Browse files
authored
fix(rust/driver_manager): try to fix flaky test (#4028)
For some reason the hierarchical path profile test is flaky, let's try to fix that
1 parent 4698ced commit f2d58a7

File tree

4 files changed

+51
-16
lines changed

4 files changed

+51
-16
lines changed

rust/Cargo.lock

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

rust/driver_manager/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@ windows-registry = { version = ">= 0.5.3" }
5757

5858
[dev-dependencies]
5959
arrow-select.workspace = true
60+
serial_test = "3.4.0"
6061
temp-env = "0.3"
6162
tempfile = "3.26"

rust/driver_manager/src/search.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -869,27 +869,16 @@ pub(crate) fn find_filesystem_profile(
869869

870870
// Search in the configured paths
871871
let path_list = get_profile_search_paths(additional_path_list);
872-
let has_toml_ext = profile_path.extension().is_some_and(|ext| ext == "toml");
873872

873+
let actual_path = profile_path.with_extension("toml");
874874
path_list
875875
.iter()
876876
.find_map(|path| {
877-
let mut full_path = path.join(profile_path.as_path());
878-
if has_toml_ext {
879-
// Name already has .toml extension, use it as-is
880-
if full_path.is_file() {
881-
Some(full_path)
882-
} else {
883-
None
884-
}
877+
let full_path = path.join(actual_path.as_path());
878+
if full_path.is_file() {
879+
Some(full_path)
885880
} else {
886-
// try adding .toml extension
887-
full_path.set_extension("toml");
888-
if full_path.is_file() {
889-
Some(full_path)
890-
} else {
891-
None
892-
}
881+
None
893882
}
894883
})
895884
.ok_or_else(|| {

rust/driver_manager/tests/connection_profile.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use adbc_driver_manager::profile::{
2323
ConnectionProfile, ConnectionProfileProvider, FilesystemProfileProvider,
2424
};
2525
use adbc_driver_manager::ManagedDatabase;
26+
use serial_test::serial;
2627

2728
mod common;
2829

@@ -432,6 +433,7 @@ fn test_profile_display() {
432433
}
433434

434435
#[test]
436+
#[serial]
435437
fn test_profile_hierarchical_path_via_env_var() {
436438
use std::env;
437439

@@ -496,6 +498,7 @@ fn test_profile_hierarchical_path_via_env_var() {
496498
}
497499

498500
#[test]
501+
#[serial]
499502
fn test_profile_hierarchical_path_with_extension_via_env_var() {
500503
use std::env;
501504

0 commit comments

Comments
 (0)