STRA-101 make embedded payload lifetime test tolerate fd reuse
Linux / keyless-cuda-gate (pull_request) Skipped
Linux / verify (pull_request) Successful in 4m22s
Linux / keyless-cuda (pull_request) Skipped
Linux / static-cuda-package (pull_request) Skipped
Linux / hosted-cuda-package (pull_request) Skipped
Linux / linux-cli-container (pull_request) Successful in 4m19s
Linux / linux-static-cli (pull_request) Failing after 10m51s
Linux / release-cli (pull_request) Skipped
Linux / keyless-cuda-gate (pull_request) Skipped
Linux / verify (pull_request) Successful in 4m22s
Linux / keyless-cuda (pull_request) Skipped
Linux / static-cuda-package (pull_request) Skipped
Linux / hosted-cuda-package (pull_request) Skipped
Linux / linux-cli-container (pull_request) Successful in 4m19s
Linux / linux-static-cli (pull_request) Failing after 10m51s
Linux / release-cli (pull_request) Skipped
This commit is contained in:
@@ -118,7 +118,7 @@ mod tests {
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn sealed_payload_is_exact_immutable_and_removed_on_drop() {
|
||||
use std::io::Write;
|
||||
use std::{io::Write, os::unix::fs::MetadataExt};
|
||||
let engine = materialize(b"immutable fixture bytes").unwrap();
|
||||
let path = engine.executable.clone();
|
||||
assert_eq!(std::fs::read(&path).unwrap(), b"immutable fixture bytes");
|
||||
@@ -126,8 +126,19 @@ mod tests {
|
||||
assert!(other.write_all(b"x").is_err());
|
||||
assert!(other.set_len(0).is_err());
|
||||
assert!(other.set_len(100).is_err());
|
||||
drop(other);
|
||||
// Keep a witness open so this inode cannot be recycled during the check.
|
||||
// Parallel tests can reuse the original descriptor number after Drop.
|
||||
let original = other.metadata().unwrap();
|
||||
assert_eq!(std::fs::metadata(&path).unwrap().ino(), original.ino());
|
||||
drop(engine);
|
||||
assert!(!path.exists());
|
||||
match std::fs::metadata(&path) {
|
||||
Ok(current) => assert_ne!(
|
||||
(current.dev(), current.ino()),
|
||||
(original.dev(), original.ino()),
|
||||
"original descriptor still refers to the payload after Drop"
|
||||
),
|
||||
Err(error) => assert_eq!(error.kind(), std::io::ErrorKind::NotFound),
|
||||
}
|
||||
drop(other);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user