Skip to content

Commit 48da0dd

Browse files
committed
test(linux): give the killed-muxer test a per-process file and remove it
1 parent ec93475 commit 48da0dd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎electron/native/pipewire-capture/src/encoder.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,9 @@ mod tests {
15251525
// Three seconds at 30 fps with audio, then a simulated kill: no trailer,
15261526
// no flush of the write buffer, no interleave queue drained (#944).
15271527
let (width, height, fps) = (64, 32, 30);
1528-
let output = std::env::temp_dir().join("openscreen-killed-muxer.mp4");
1528+
// Per process, so two test runs on one machine never share the file.
1529+
let output = std::env::temp_dir()
1530+
.join(format!("openscreen-killed-muxer-{}.mp4", std::process::id()));
15291531
let _ = std::fs::remove_file(&output);
15301532
let mut video = VideoEncoder::open(
15311533
VideoParams { width, height, fps, bitrate: 1_000_000 },
@@ -1590,6 +1592,7 @@ mod tests {
15901592
// slides 21 ms off its capture time (see FRAGMENT_OPTIONS).
15911593
let one_frame = 1.0 / f64::from(fps);
15921594
assert!((second_frame_at - one_frame).abs() < 1e-3, "frame 1 at {second_frame_at} s");
1595+
let _ = std::fs::remove_file(&output);
15931596
}
15941597

15951598
#[test]

0 commit comments

Comments
 (0)