Skip to content

Commit e49d7ec

Browse files
make test_update_doc_mapping_* less flaky (#5753)
* fix some flaky tests * fix edition issue
1 parent c7d3314 commit e49d7ec

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

quickwit/Cargo.lock

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

quickwit/quickwit-integration-tests/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ aws-sdk-sqs = { workspace = true }
2424
futures-util = { workspace = true }
2525
hyper = { workspace = true }
2626
itertools = { workspace = true }
27+
rand = { workspace = true }
2728
reqwest = { workspace = true }
2829
serde_json = { workspace = true }
2930
tempfile = { workspace = true }

quickwit/quickwit-integration-tests/src/test_utils/cluster_sandbox.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use quickwit_serve::{
4343
ListSplitsQueryParams, RestIngestResponse, SearchRequestQueryString, serve_quickwit,
4444
};
4545
use quickwit_storage::StorageResolver;
46+
use rand::Rng;
4647
use reqwest::Url;
4748
use serde_json::Value;
4849
use tempfile::TempDir;
@@ -480,13 +481,20 @@ impl ClusterSandbox {
480481
.ok_or(anyhow::anyhow!("No indexer node found"))?;
481482
// NodeConfig cannot be serialized, we write our own simplified config
482483
let mut tmp_config_file = tempfile::Builder::new().suffix(".yaml").tempfile().unwrap();
484+
// we suffix data_dir with a random slug to save us from multiple local ingestion trying to
485+
// concurrently do something, and cleanup the directory to start a new ingestion.
486+
let data_dir = test_conf
487+
.0
488+
.data_dir_path
489+
.join(rand::thread_rng().r#gen::<u64>().to_string());
490+
tokio::fs::create_dir(&data_dir).await?;
483491
let node_config = format!(
484492
r#"
485493
version: 0.8
486494
metastore_uri: {}
487495
data_dir: {:?}
488496
"#,
489-
test_conf.0.metastore_uri, test_conf.0.data_dir_path
497+
test_conf.0.metastore_uri, data_dir
490498
);
491499
tmp_config_file.write_all(node_config.as_bytes())?;
492500
tmp_config_file.flush()?;

0 commit comments

Comments
 (0)