Skip to content

Commit ebb4f50

Browse files
committed
fix: Add #[serial] to env var tests to prevent race conditions in CI
1 parent 3867f3f commit ebb4f50

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/pdsh_compat_test.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
//! and behaves as expected in pdsh compatibility mode.
1919
2020
use bssh::cli::{has_pdsh_compat_flag, remove_pdsh_compat_flag, PdshCli, PDSH_COMPAT_ENV_VAR};
21+
use serial_test::serial;
2122
use std::env;
2223

2324
/// Helper to run a test with env var protection
@@ -116,6 +117,7 @@ fn test_remove_pdsh_compat_flag_no_flag_present() {
116117
// =============================================================================
117118

118119
#[test]
120+
#[serial]
119121
fn test_env_var_detection_with_one() {
120122
without_env_var(PDSH_COMPAT_ENV_VAR, || {
121123
with_env_var(PDSH_COMPAT_ENV_VAR, "1", || {
@@ -130,6 +132,7 @@ fn test_env_var_detection_with_one() {
130132
}
131133

132134
#[test]
135+
#[serial]
133136
fn test_env_var_detection_with_true() {
134137
without_env_var(PDSH_COMPAT_ENV_VAR, || {
135138
with_env_var(PDSH_COMPAT_ENV_VAR, "true", || {
@@ -141,6 +144,7 @@ fn test_env_var_detection_with_true() {
141144
}
142145

143146
#[test]
147+
#[serial]
144148
fn test_env_var_detection_disabled_with_zero() {
145149
without_env_var(PDSH_COMPAT_ENV_VAR, || {
146150
with_env_var(PDSH_COMPAT_ENV_VAR, "0", || {
@@ -154,6 +158,7 @@ fn test_env_var_detection_disabled_with_zero() {
154158
}
155159

156160
#[test]
161+
#[serial]
157162
fn test_env_var_detection_disabled_with_false() {
158163
without_env_var(PDSH_COMPAT_ENV_VAR, || {
159164
with_env_var(PDSH_COMPAT_ENV_VAR, "false", || {

0 commit comments

Comments
 (0)