Skip to content

Commit 560d090

Browse files
committed
Fix test isolation
1 parent 77b1b8c commit 560d090

5 files changed

Lines changed: 13 additions & 0 deletions

File tree

--body

Whitespace-only changes.

--json

Whitespace-only changes.

.github/workflows/tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ jobs:
9898
# Run all tests without CI workarounds since this is a self-hosted runner
9999
sudo -E $(which cargo) nextest run --profile ci --test linux_integration --verbose
100100
101+
- name: Run isolated cleanup tests
102+
run: |
103+
source ~/.cargo/env
104+
# Run only the comprehensive cleanup and sigint tests with the feature flag
105+
# These tests need to run in isolation from other tests
106+
sudo -E $(which cargo) test --test linux_integration --features isolated-cleanup-tests -- test_comprehensive_resource_cleanup test_cleanup_after_sigint
107+
101108
test-weak:
102109
name: Weak Mode Integration Tests (Linux)
103110
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name = "httpjail"
33
version = "0.1.0"
44
edition = "2024"
55

6+
[features]
7+
# Feature to enable isolated cleanup tests that should run separately in CI
8+
isolated-cleanup-tests = []
9+
610
[dependencies]
711
clap = { version = "4.5", features = ["derive"] }
812
regex = "1.10"

tests/linux_integration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ mod tests {
8989
/// Comprehensive test to verify all resources are cleaned up after jail execution
9090
#[test]
9191
#[serial]
92+
#[cfg(feature = "isolated-cleanup-tests")]
9293
fn test_comprehensive_resource_cleanup() {
9394
LinuxPlatform::require_privileges();
9495

@@ -217,6 +218,7 @@ mod tests {
217218
/// Test cleanup after abnormal termination (SIGINT)
218219
#[test]
219220
#[serial]
221+
#[cfg(feature = "isolated-cleanup-tests")]
220222
fn test_cleanup_after_sigint() {
221223
LinuxPlatform::require_privileges();
222224

0 commit comments

Comments
 (0)