Skip to content

Commit fe8ca69

Browse files
committed
fix nits
1 parent a6c4f0a commit fe8ca69

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ chrono = "0.4.45"
4444
jsonwebtoken = { version = "10.4.0", features = ["aws_lc_rs"] }
4545
reqwest = { version = "0.13.4", features = ["blocking", "socks"] }
4646
rstest = "0.26.1"
47+
serial_test = "3.5.0"
4748
windows = "0.62.2"
4849
windows-sys = "0.61.2"
4950
aws-lc-rs = "1.17.1"

agent-control/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fs = { path = "../fs", features = ["mocks"] }
116116
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
117117
fake = { version = "5.1.0", features = ["derive", "http"] }
118118
httpmock = { version = "0.8.3", features = ["proxy"] }
119-
serial_test = "3.5.0"
119+
serial_test = { workspace = true }
120120
futures = "0.3.32"
121121
rcgen = { version = "0.14.8", features = ["crypto"] }
122122
rstest = { workspace = true }

self-replacer/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ tempfile = { workspace = true }
1515

1616
[dev-dependencies]
1717
assert_matches = { workspace = true }
18-
assert_cmd = "2.2.2"
19-
predicates = "3.1.4"
20-
serial_test = "3.5.0"
18+
assert_cmd = { workspace = true }
19+
predicates = { workspace = true }
20+
serial_test = { workspace = true }
2121

2222
[target.'cfg(target_os = "windows")'.dev-dependencies]
2323
windows = { workspace = true, features = [

self-replacer/tests/integration_tests.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ use self_replacer::BACKUP_SUFFIX;
1919
// Common tests that run on all platforms
2020
// ============================================================================
2121

22+
// Must run serially: this test writes an executable and then execs it. If another test runs
23+
// in parallel, its `Command` fork+exec can inherit our still-open write fd to the freshly
24+
// written binary during the fork->exec window, so our exec fails with ETXTBSY ("text file
25+
// busy", os error 26). O_CLOEXEC does not help because the fd is only closed on exec, not fork.
26+
// Serializing removes the write/exec overlap. (test_rollback_on_invalid_path needs no serial:
27+
// it never execs a freshly written binary.)
2228
#[test]
2329
#[serial]
2430
fn test_self_replacement_with_real_binary() {
@@ -130,6 +136,8 @@ mod unix_specific {
130136

131137
const TEST_EXEC_MODE: u32 = 0o754; // rwxr-xr--
132138

139+
// Serial for the same reason as test_self_replacement_with_real_binary: writing then
140+
// exec-ing a binary races another test's fork+exec and hits ETXTBSY (os error 26).
133141
#[test]
134142
#[serial]
135143
fn test_permission_preservation_with_real_binary() {

0 commit comments

Comments
 (0)