From 83e6759a2709711053516bd1431f88df4df6313f Mon Sep 17 00:00:00 2001 From: brizental Date: Tue, 14 Jul 2020 13:01:36 +0200 Subject: [PATCH] Set different env vars for each test in debug.rs This is important because test run in parallel, if both tests are changing the same env var at the same time, we get intermittent failures. --- glean-core/src/debug.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glean-core/src/debug.rs b/glean-core/src/debug.rs index 88aa969a3f..e866e3525f 100644 --- a/glean-core/src/debug.rs +++ b/glean-core/src/debug.rs @@ -171,8 +171,8 @@ mod test { #[test] fn debug_option_is_correctly_loaded_from_env() { - env::set_var("GLEAN_TEST", "test"); - let option: DebugOption = DebugOption::new("GLEAN_TEST", None); + env::set_var("GLEAN_TEST_1", "test"); + let option: DebugOption = DebugOption::new("GLEAN_TEST_1", None); assert_eq!(option.get().unwrap(), "test"); } @@ -187,8 +187,8 @@ mod test { } // Invalid values from the env are not set - env::set_var("GLEAN_TEST", "invalid"); - let mut option: DebugOption = DebugOption::new("GLEAN_TEST", Some(validate)); + env::set_var("GLEAN_TEST_2", "invalid"); + let mut option: DebugOption = DebugOption::new("GLEAN_TEST_2", Some(validate)); assert!(option.get().is_none()); // Valid values are set using the `set` function