fix: fix flaky `test_unload_partition_chunk`

Do not rely on the fact that the chunk ID is 1, because compaction and
other mechanisms might create chunks using different IDs.

Fixes #2109.
pull/24376/head
Marco Neumann 2021-07-26 12:00:43 +02:00
parent ceacd6b4e7
commit c386ac013c
1 changed files with 3 additions and 2 deletions

View File

@ -722,13 +722,14 @@ async fn test_unload_partition_chunk() {
let lp_data = vec!["cpu,region=west user=23.2 10"]; let lp_data = vec!["cpu,region=west user=23.2 10"];
load_lp(addr, &db_name, lp_data); load_lp(addr, &db_name, lp_data);
wait_for_exact_chunk_states( let mut chunks = wait_for_exact_chunk_states(
&fixture, &fixture,
&db_name, &db_name,
vec![ChunkStorage::ReadBufferAndObjectStore], vec![ChunkStorage::ReadBufferAndObjectStore],
std::time::Duration::from_secs(5), std::time::Duration::from_secs(5),
) )
.await; .await;
let chunk = chunks.pop().unwrap();
Command::cargo_bin("influxdb_iox") Command::cargo_bin("influxdb_iox")
.unwrap() .unwrap()
@ -738,7 +739,7 @@ async fn test_unload_partition_chunk() {
.arg(&db_name) .arg(&db_name)
.arg("cpu") .arg("cpu")
.arg("cpu") .arg("cpu")
.arg("1") .arg(chunk.id.to_string())
.arg("--host") .arg("--host")
.arg(addr) .arg(addr)
.assert() .assert()