fix(lifecycle): restore #[serial] on 2 tests that read env vars without temp_env

eval_inner_expires_latest_object_after_days_due and
eval_inner_does_not_panic_on_many_equal_due_events call eval_inner()
which reads ENV_ILM_PROCESS_TIME via std::env::var(). Without #[serial]
they race with other tests that set these vars via temp_env.
This commit is contained in:
overtrue
2026-08-22 01:22:19 +08:00
parent 3f6cd10946
commit 861cc8db2c
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -69,6 +69,7 @@ uuid = { workspace = true, features = ["v4", "serde", "fast-rng", "macro-diagnos
[dev-dependencies]
metrics-util = { workspace = true, features = ["debugging"] }
proptest = "1"
serial_test = { workspace = true }
temp-env.workspace = true
tokio = { workspace = true, features = ["macros", "fs", "rt-multi-thread"] }
+3
View File
@@ -1114,6 +1114,7 @@ mod tests {
use metrics_util::MetricKind;
use metrics_util::debugging::{DebugValue, DebuggingRecorder};
use s3s::dto::{LifecycleRuleFilter, TransitionStorageClass};
use serial_test::serial;
use std::sync::Arc;
use time::macros::datetime;
@@ -1898,6 +1899,7 @@ mod tests {
}
#[tokio::test]
#[serial]
async fn eval_inner_expires_latest_object_after_days_due() {
let base_time = datetime!(2025-01-15 10:30:45 UTC);
let lc = BucketLifecycleConfiguration {
@@ -2113,6 +2115,7 @@ mod tests {
}
#[tokio::test]
#[serial]
async fn eval_inner_does_not_panic_on_many_equal_due_events() {
let base_time = OffsetDateTime::from_unix_timestamp(1_000_000).unwrap();
// Many enabled rules that all yield a DeleteAction with an identical `due`.