Merge remote-tracking branch 'origin/main' into hoytak/260317-download-streams

This commit is contained in:
Hoyt Koepke
2026-03-20 13:34:51 -07:00
24 changed files with 52 additions and 6 deletions

View File

@@ -2,3 +2,6 @@
# the following is necessary when compiling rand & getrandom for wasm
# https://github.com/rust-random/getrandom/blob/master/README.md#webassembly-support
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
[alias]
smoke-test = "test --profile smoke-test --features xet-runtime/smoke-test,xet-core-structures/smoke-test,xet-client/smoke-test,xet-data/smoke-test,hf-xet/smoke-test,git_xet/smoke-test,simulation/smoke-test"

View File

@@ -30,6 +30,9 @@ inherits = "dev"
opt-level = 3
debug = 1
[profile.smoke-test]
inherits = "dev"
[workspace.dependencies]
anyhow = "1"
async-std = "1"

View File

@@ -36,6 +36,7 @@ tokio = { workspace = true }
serial_test = { workspace = true }
[features]
smoke-test = []
git-xet-for-integration-test = []
git2-vendored-openssl = ["git2/vendored-openssl"]

View File

@@ -163,6 +163,7 @@ mod tests {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_send_monotonic_increasing_updates() -> Result<()> {
// Test that progress updates should be monotonic increasing, regardless of
// reordering of tasks calling into the `update_bytes_so_far` function.
@@ -208,6 +209,7 @@ mod tests {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_concurrent_updates() -> Result<()> {
// Test that concurrent updates don't wait for turns to send progress messages: only
// the first one that acquires the channel will send and others will skip.

View File

@@ -37,5 +37,8 @@ reqwest = { workspace = true }
reqwest-middleware = { workspace = true }
tracing-subscriber = { workspace = true }
[features]
smoke-test = []
[dev-dependencies]
tempfile = { workspace = true }

View File

@@ -390,6 +390,7 @@ mod tests {
/// Runs a full scenario: start server, add upload client, run 3s, shutdown, then verify
/// output directory has network_stats.json, timeline.csv, client_parameters_*.json, client_stats_*.json.
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn scenario_run_3_seconds_shutdown_verify_output() {
let temp = tempfile::tempdir().unwrap();
let out_dir = temp.path().to_path_buf();

View File

@@ -60,6 +60,7 @@ warp = { workspace = true }
[features]
strict = []
smoke-test = []
default = ["rustls-tls"]
elevated_information_level = []
rustls-tls = ["reqwest/rustls"]

View File

@@ -1298,6 +1298,7 @@ mod tests {
/// Runs the common DirectAccessClient test suite via SimulationControlClient.
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_simulation_control_client_common_suite() {
crate::cas_client::simulation::client_unit_testing::test_client_functionality(|| async {
let lc = LocalClient::temporary().await.unwrap();
@@ -1311,6 +1312,7 @@ mod tests {
/// Runs the common DeletionControlableClient test suite via SimulationControlClient.
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_simulation_control_client_deletion_suite() {
crate::cas_client::simulation::deletion_unit_testing::test_deletion_functionality(|| async {
let lc = LocalClient::temporary().await.unwrap();

View File

@@ -357,6 +357,7 @@ mod tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_client_functionality_through_socket_proxy() {
use std::sync::Arc;

View File

@@ -1305,6 +1305,7 @@ mod concurrency_tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_run_concurrently_with_evictions() {
let cache_root = TempDir::new("run_concurrently_with_evictions").unwrap();
let config = CacheConfig {

View File

@@ -28,6 +28,7 @@ async fn test_shard_upload_succeeds_with_no_server_delay() {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_shard_upload_succeeds_with_slow_server() {
let server = LocalTestServerBuilder::new().start().await;

View File

@@ -85,3 +85,4 @@ name = "bg4_prediction_benchmark"
[features]
strict = []
smoke-test = []

View File

@@ -1110,6 +1110,7 @@ mod tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_timestamp_filtering() -> Result<()> {
let tmp_dir = TempDir::with_prefix("shard_test_timestamp")?;
let tmp_dir_path = tmp_dir.path();
@@ -1172,6 +1173,7 @@ mod tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_export_expiration() -> Result<()> {
let tmp_dir = TempDir::with_prefix("shard_test_timestamp_2")?;
let tmp_dir_path = tmp_dir.path();

View File

@@ -87,5 +87,6 @@ harness = false
[features]
strict = []
smoke-test = []
expensive_tests = []
python = ["dep:pyo3"]

View File

@@ -294,6 +294,7 @@ mod tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_hash_determinism() {
let temp_dir = tempdir().unwrap();
let file_path = temp_dir.path().join("test.txt");
@@ -355,6 +356,7 @@ mod tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_hash_file_size_multiple_of_buffer() {
// Regression test for bug where final chunk wasn't produced when file size
// is exactly a multiple of buffer_size. This test verifies that

View File

@@ -112,6 +112,7 @@ mod git_integration_tests {
use super::*;
#[test]
#[cfg_attr(feature = "smoke-test", ignore)]
fn test_basic_read() -> Result<()> {
IntegrationTest::new(include_str!("integration_tests/test_basic_clean_smudge.sh")).run()
}

View File

@@ -1,4 +1,5 @@
use xet_data::deduplication::constants::{MAX_XORB_BYTES, MAX_XORB_CHUNKS, TARGET_CHUNK_SIZE};
#[cfg(all(test, not(feature = "smoke-test")))]
use xet_data::processing::test_utils::*;
use xet_runtime::test_set_constants;
@@ -19,6 +20,7 @@ test_set_constants! {
/// - ServerV2: LocalTestServer with default V2 reconstruction
/// - ServerV1Fallback: LocalTestServer with V2 disabled (tests V1-to-V2 conversion)
/// - ServerMaxRanges2: LocalTestServer with max_ranges_per_fetch=2 (tests fetch splitting)
#[cfg(all(test, not(feature = "smoke-test")))]
pub async fn check_clean_smudge_files(file_list: &[(impl AsRef<str> + Clone, usize)]) {
for &mode in HydrationMode::all() {
for sequential in [true, false] {
@@ -44,6 +46,7 @@ pub async fn check_clean_smudge_files(file_list: &[(impl AsRef<str> + Clone, usi
/// - for each file, calls `create_random_multipart_file` with the given segments.
///
/// Exercises all hydration modes just like `check_clean_smudge_files`.
#[cfg(all(test, not(feature = "smoke-test")))]
async fn check_clean_smudge_files_multipart(file_specs: &[(String, Vec<(usize, u64)>)]) {
for &mode in HydrationMode::all() {
for sequential in [true, false] {
@@ -67,7 +70,7 @@ async fn check_clean_smudge_files_multipart(file_specs: &[(String, Vec<(usize, u
}
}
#[cfg(test)]
#[cfg(all(test, not(feature = "smoke-test")))]
mod testing_clean_smudge {
use super::*;

View File

@@ -5,6 +5,7 @@
//! multirange HTTP request path rather than the default single-range splitting.
use xet_data::deduplication::constants::{MAX_XORB_BYTES, MAX_XORB_CHUNKS, TARGET_CHUNK_SIZE};
#[cfg(all(test, not(feature = "smoke-test")))]
use xet_data::processing::test_utils::*;
use xet_runtime::{test_set_config, test_set_constants};
@@ -20,7 +21,7 @@ test_set_config! {
}
}
#[cfg(test)]
#[cfg(all(test, not(feature = "smoke-test")))]
mod testing_clean_smudge_multirange {
use super::*;

View File

@@ -30,6 +30,7 @@ tracing = { workspace = true }
pyo3 = { workspace = true, optional = true }
[features]
smoke-test = []
python = ["xet-runtime/python", "dep:pyo3"]
[dev-dependencies]

View File

@@ -61,6 +61,7 @@ libc = { workspace = true }
[features]
strict = []
smoke-test = []
elevated_information_level = []
no-default-cache = []
python = ["dep:pyo3"]

View File

@@ -193,12 +193,15 @@ mod tests {
File::open(&dest_path).unwrap().read_to_string(&mut contents).unwrap();
assert_eq!(contents.trim(), "Hello, world!");
// Verify file permissions
// Verify file permissions: owner should have read/write.
// Group/other bits depend on host umask and may vary (e.g. 0o600 vs 0o644).
#[cfg(unix)]
{
let metadata = std::fs::metadata(&dest_path).unwrap();
let permissions = metadata.permissions();
assert_eq!(permissions.mode() & 0o777, 0o644); // Assuming default creation mode
let mode = permissions.mode() & 0o777;
// Default creation mode is 0o666 masked by umask.
assert!(mode & 0o600 == 0o600, "Owner should have rw permissions, got {mode:#o}");
}
}
@@ -222,12 +225,15 @@ mod tests {
File::open(&dest_path).unwrap().read_to_string(&mut contents).unwrap();
assert_eq!(contents.trim(), "Hello, world!");
// Verify file permissions
// Verify file permissions: owner should have read/write.
// Group/other bits depend on host umask and may vary (e.g. 0o600 vs 0o644).
#[cfg(unix)]
{
let metadata = std::fs::metadata(&dest_path).unwrap();
let permissions = metadata.permissions();
assert_eq!(permissions.mode() & 0o777, 0o644); // Assuming default creation mode
let mode = permissions.mode() & 0o777;
// Default creation mode is 0o666 masked by umask.
assert!(mode & 0o600 == 0o600, "Owner should have rw permissions, got {mode:#o}");
}
}

View File

@@ -558,6 +558,7 @@ mod tests {
#[test]
#[serial(monitor_process)]
#[cfg_attr(feature = "smoke-test", ignore)]
fn test_monitor_self_disk_usage() -> Result<()> {
// Verifies that the system monitor correctly tracks and reports disk usage of this process
@@ -605,6 +606,7 @@ mod tests {
#[test]
#[serial(monitor_process)]
#[cfg_attr(feature = "smoke-test", ignore)]
fn test_monitor_self_memory_usage() -> Result<()> {
// Verifies that the system monitor correctly tracks and reports peak memory usage.
let tempdir = tempdir()?;

View File

@@ -664,6 +664,7 @@ mod tests {
// ── Concurrent stress test ───────────────────────────────────
#[tokio::test(flavor = "multi_thread", worker_threads = 8)]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_concurrent_stress() {
const TASKS: usize = 50;
const OPS_PER_TASK: usize = 1000;
@@ -717,6 +718,7 @@ mod tests {
// ── Concurrent stress with acquire_many ──────────────────────
#[tokio::test(flavor = "multi_thread", worker_threads = 8)]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_concurrent_stress_acquire_many() {
const TASKS: usize = 30;
const OPS_PER_TASK: usize = 500;

View File

@@ -448,6 +448,7 @@ pub(crate) mod tests {
}
#[test]
#[cfg_attr(feature = "smoke-test", ignore)]
fn test_multiple_threads_with_threadpool() {
let times_called = Arc::new(AtomicU32::new(0));
let threadpool = Arc::new(XetRuntime::new().unwrap());
@@ -482,6 +483,7 @@ pub(crate) mod tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_multiple_threads() {
let times_called = Arc::new(AtomicU32::new(0));
let g: Arc<Group<usize, ()>> = Arc::new(Group::new());
@@ -511,6 +513,7 @@ pub(crate) mod tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_error() {
let times_called = Arc::new(AtomicU32::new(0));
@@ -540,6 +543,7 @@ pub(crate) mod tests {
}
#[tokio::test]
#[cfg_attr(feature = "smoke-test", ignore)]
async fn test_multiple_keys() {
let times_called_x = Arc::new(AtomicU32::new(0));
let times_called_y = Arc::new(AtomicU32::new(0));