diff --git a/rust/crates/pumas-core/src/discovery/tests.rs b/rust/crates/pumas-core/src/discovery/tests.rs index 4385ac0a..08508f46 100644 --- a/rust/crates/pumas-core/src/discovery/tests.rs +++ b/rust/crates/pumas-core/src/discovery/tests.rs @@ -503,12 +503,29 @@ async fn ordinary_drop_retains_owner_until_real_finite_index_mutation_and_ipc_se .is_err()); // This diagnostic handle still owns the mutable library after settlement. drop(primary); - let successor = attach_or_start( - registry.clone(), - &root, - &CompatibilityRequirements::default(), - ) + // Dropping the owner does not release the native store lock immediately: + // a child spawned by a parallel test can briefly inherit its descriptor. + // Only that busy refusal is retried, within a bound. + let successor = tokio::time::timeout(std::time::Duration::from_secs(5), async { + loop { + match attach_or_start( + registry.clone(), + &root, + &CompatibilityRequirements::default(), + ) + .await + { + Err(crate::PumasError::InvalidParams { message }) + if message.contains("already running for physical store") => + { + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + } + other => break other, + } + } + }) .await + .expect("physical store lease was not released after the owner dropped") .unwrap(); assert!(matches!(&successor, LocalAccess::Owned { .. })); successor.shutdown_owned().await.unwrap(); diff --git a/rust/crates/pumas-core/src/model_library/identifier.rs b/rust/crates/pumas-core/src/model_library/identifier.rs index 2dbdb88c..d0025d4f 100644 --- a/rust/crates/pumas-core/src/model_library/identifier.rs +++ b/rust/crates/pumas-core/src/model_library/identifier.rs @@ -209,8 +209,20 @@ fn identify_gguf(file: &mut R, path: &Path) -> Result {} + // Too short for a GGUF header: malformed content, not a failed read. + // Validation reports the unusable file; import must not fail on it. + Err(error) if error.kind() == std::io::ErrorKind::UnexpectedEof => { + return Ok(ModelTypeInfo { + format: FileFormat::Gguf, + model_type: ModelType::Unknown, + family: None, + extra: HashMap::new(), + }); + } + Err(error) => return Err(PumasError::io_with_path(error, path)), + } let version = u32::from_le_bytes(header[4..8].try_into().unwrap()); let metadata_count = u64::from_le_bytes(header[16..24].try_into().unwrap()); @@ -1033,6 +1045,23 @@ pub fn extract_gguf_metadata(path: impl AsRef) -> Result= release_deadline + { + break attempt; + } + drop(attempt); + std::thread::sleep(Duration::from_millis(10)); + }; assert!( after_confirmed_drain.is_ok(), "confirmed fixture drain did not release physical store: {after_confirmed_drain:?}"