This is an automated email from the ASF dual-hosted git repository.
zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new f2d58a74e fix(rust/driver_manager): try to fix flaky test (#4028)
f2d58a74e is described below
commit f2d58a74e7e0ca4a1937037d1a7ad87ccbb17442
Author: Matt Topol <[email protected]>
AuthorDate: Fri Feb 27 17:52:09 2026 -0500
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
---
rust/Cargo.lock | 42 +++++++++++++++++++++++++
rust/driver_manager/Cargo.toml | 1 +
rust/driver_manager/src/search.rs | 21 +++----------
rust/driver_manager/tests/connection_profile.rs | 3 ++
4 files changed, 51 insertions(+), 16 deletions(-)
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 826c490c0..823a9371e 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -38,6 +38,7 @@ dependencies = [
"libloading",
"path-slash",
"regex",
+ "serial_test",
"temp-env",
"tempfile",
"toml",
@@ -2210,6 +2211,15 @@ dependencies = [
"winapi-util",
]
+[[package]]
+name = "scc"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46e6f046b7fef48e2660c57ed794263155d713de679057f2d0c169bfc6e756cc"
+dependencies = [
+ "sdd",
+]
+
[[package]]
name = "schemars"
version = "0.8.22"
@@ -2240,6 +2250,12 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+[[package]]
+name = "sdd"
+version = "3.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "490dcfcbfef26be6800d11870ff2df8774fa6e86d047e3e8c8a76b25655e41ca"
+
[[package]]
name = "semver"
version = "1.0.27"
@@ -2338,6 +2354,32 @@ dependencies = [
"unsafe-libyaml",
]
+[[package]]
+name = "serial_test"
+version = "3.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "911bd979bf1070a3f3aa7b691a3b3e9968f339ceeec89e08c280a8a22207a32f"
+dependencies = [
+ "futures-executor",
+ "futures-util",
+ "log",
+ "once_cell",
+ "parking_lot",
+ "scc",
+ "serial_test_derive",
+]
+
+[[package]]
+name = "serial_test_derive"
+version = "3.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0a7d91949b85b0d2fb687445e448b40d322b6b3e4af6b44a29b21d9a5f33e6d9"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
[[package]]
name = "shlex"
version = "1.3.0"
diff --git a/rust/driver_manager/Cargo.toml b/rust/driver_manager/Cargo.toml
index 6afc0878b..32ac606e4 100644
--- a/rust/driver_manager/Cargo.toml
+++ b/rust/driver_manager/Cargo.toml
@@ -57,5 +57,6 @@ windows-registry = { version = ">= 0.5.3" }
[dev-dependencies]
arrow-select.workspace = true
+serial_test = "3.4.0"
temp-env = "0.3"
tempfile = "3.26"
diff --git a/rust/driver_manager/src/search.rs
b/rust/driver_manager/src/search.rs
index c8a7ec399..e3476e00d 100644
--- a/rust/driver_manager/src/search.rs
+++ b/rust/driver_manager/src/search.rs
@@ -869,27 +869,16 @@ pub(crate) fn find_filesystem_profile(
// Search in the configured paths
let path_list = get_profile_search_paths(additional_path_list);
- let has_toml_ext = profile_path.extension().is_some_and(|ext| ext ==
"toml");
+ let actual_path = profile_path.with_extension("toml");
path_list
.iter()
.find_map(|path| {
- let mut full_path = path.join(profile_path.as_path());
- if has_toml_ext {
- // Name already has .toml extension, use it as-is
- if full_path.is_file() {
- Some(full_path)
- } else {
- None
- }
+ let full_path = path.join(actual_path.as_path());
+ if full_path.is_file() {
+ Some(full_path)
} else {
- // try adding .toml extension
- full_path.set_extension("toml");
- if full_path.is_file() {
- Some(full_path)
- } else {
- None
- }
+ None
}
})
.ok_or_else(|| {
diff --git a/rust/driver_manager/tests/connection_profile.rs
b/rust/driver_manager/tests/connection_profile.rs
index 1da5d87e6..e1bdd353f 100644
--- a/rust/driver_manager/tests/connection_profile.rs
+++ b/rust/driver_manager/tests/connection_profile.rs
@@ -23,6 +23,7 @@ use adbc_driver_manager::profile::{
ConnectionProfile, ConnectionProfileProvider, FilesystemProfileProvider,
};
use adbc_driver_manager::ManagedDatabase;
+use serial_test::serial;
mod common;
@@ -432,6 +433,7 @@ fn test_profile_display() {
}
#[test]
+#[serial]
fn test_profile_hierarchical_path_via_env_var() {
use std::env;
@@ -496,6 +498,7 @@ fn test_profile_hierarchical_path_via_env_var() {
}
#[test]
+#[serial]
fn test_profile_hierarchical_path_with_extension_via_env_var() {
use std::env;