Skip to content

Commit 7bd7781

Browse files
committed
gemini comment
Signed-off-by: Eren Atas <[email protected]>
1 parent cff5162 commit 7bd7781

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

crates/flagd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ tonic-prost-build = "0.14"
2727
cucumber = "0.21"
2828
tokio-stream = "0.1"
2929
futures-core = "0.3"
30-
testcontainers = { version = "0.25.0", features = ["http_wait", "blocking"] }
30+
testcontainers = { version = "0.25", features = ["http_wait", "blocking"] }
3131
wiremock = "0.6.5"
3232
tempfile = "3.23.0"
3333
serial_test = "3.2"

crates/flagd/tests/gherkin_config_test.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
use cucumber::{World, given, then, when};
22
use open_feature_flagd::{CacheSettings, CacheType, FlagdOptions, FlagdProvider, ResolverType};
33
use std::collections::HashMap;
4-
use std::sync::Mutex;
54
use test_log::test;
65

7-
// Global lock to ensure env var tests don't interfere with each other
8-
static ENV_LOCK: Mutex<()> = Mutex::new(());
9-
106
#[derive(Debug, World)]
117
#[world(init = Self::new)]
128
struct ConfigWorld {
@@ -29,7 +25,7 @@ impl ConfigWorld {
2925
fn clear(&mut self) {
3026
// SAFETY: Removing environment variables is safe here because:
3127
// 1. We're only removing variables that were set during this specific test scenario
32-
// 2. The test is protected by #[serial_test::serial] and ENV_LOCK
28+
// 2. The test is protected by #[serial_test::serial]
3329
// 3. This prevents test pollution between scenarios
3430
// 4. All variables being removed are tracked in world.env_vars
3531
for key in self.env_vars.keys() {
@@ -98,9 +94,8 @@ async fn env_with_value(world: &mut ConfigWorld, env: String, value: String) {
9894

9995
// SAFETY: Setting environment variables is safe here because:
10096
// 1. The test function is annotated with #[serial_test::serial], ensuring no parallel execution
101-
// 2. We hold ENV_LOCK for the entire test duration (acquired in config_test())
102-
// 3. ConfigWorld::clear() is called before each scenario to clean up all env vars
103-
// 4. All env vars set during the test are tracked in world.env_vars for guaranteed cleanup
97+
// 2. ConfigWorld::clear() is called before each scenario to clean up all env vars
98+
// 3. All env vars set during the test are tracked in world.env_vars for guaranteed cleanup
10499
//
105100
// Note: We cannot use temp-env here because it only sets variables within a closure scope,
106101
// but cucumber scenarios need variables to persist across multiple async step functions.
@@ -286,9 +281,6 @@ async fn check_option_value(
286281
#[serial_test::serial]
287282
async fn config_test() {
288283
// tracing_subscriber::fmt::init();
289-
// Acquire global lock to ensure env var safety across scenarios
290-
let _lock = ENV_LOCK.lock().unwrap();
291-
292284
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
293285
let feature_path = format!("{}/flagd-testbed/gherkin/config.feature", manifest_dir);
294286
ConfigWorld::cucumber()

0 commit comments

Comments
 (0)