Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

test(verify): synthetic microphone registers its stream health; platform priorities in the harness tests

Richie McIlroy3699d10fa5d8
diff --git a/.github/workflows/verify-recording-windows.yml b/.github/workflows/verify-recording-windows.yml
index 9c155f5c9..c9ac766d3 100644
--- a/.github/workflows/verify-recording-windows.yml
+++ b/.github/workflows/verify-recording-windows.yml
@@ -47,6 +47,7 @@ jobs:
persist-credentials: false
- name: Setup
+ id: setup
uses: ./.github/actions/engine-verify-setup
with:
target: x86_64-pc-windows-msvc
@@ -60,6 +61,17 @@ jobs:
cargo test --locked --profile ci-verify -p cap-verify --test recording --no-run
echo "build seconds: $(( $(date +%s) - start ))"
+ - name: Save build cache
+ if: steps.setup.outputs.build-cache-hit != 'true'
+ uses: actions/cache/save@v4
+ with:
+ path: |
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ target/ci-verify/
+ key: ${{ steps.setup.outputs.build-cache-key }}
+
- name: Real-capture recording oracle
shell: bash
run: cargo test --locked --profile ci-verify -p cap-verify --test recording -- --nocapture
diff --git a/crates/recording/src/feeds/microphone.rs b/crates/recording/src/feeds/microphone.rs
index df542c01f..9c955e5b2 100644
--- a/crates/recording/src/feeds/microphone.rs
+++ b/crates/recording/src/feeds/microphone.rs
@@ -3137,6 +3137,12 @@ pub mod synthetic {
done_tx,
}),
});
+ // A recording subscription attaches to the input's stream
+ // health, which opening a real input registers.
+ #[cfg(any(target_os = "linux", windows))]
+ let _ = feed
+ .stream_health
+ .insert(STREAM_ID, Arc::new(StreamHealth::new(STREAM_ID)));
Self {
feed: MicrophoneFeed::spawn(feed),
sample_rate,
diff --git a/crates/verify/tests/recording.rs b/crates/verify/tests/recording.rs
index 9547a7030..9f430425a 100644
--- a/crates/verify/tests/recording.rs
+++ b/crates/verify/tests/recording.rs
@@ -1752,8 +1752,8 @@ fn test_trace(name: &'static str, handoffs: Vec<Handoff>) -> SourceTrace {
};
let state = sched::ThreadState {
policy: 2,
- base_pri: 97,
- cur_pri: 97,
+ base_pri: sched::REALTIME_PRIORITY,
+ cur_pri: sched::REALTIME_PRIORITY,
max_pri: 63,
cpu_us: 0,
};
@@ -1801,7 +1801,7 @@ fn simulated_handoffs(
built,
pushed,
admission: admission(slot),
- pri: 97,
+ pri: sched::REALTIME_PRIORITY,
}
})
.collect()
@@ -1883,12 +1883,16 @@ fn source_lateness_is_attributed_to_the_source_or_to_cap() {
);
// A source below the real-time band is a harness failure.
let mut demoted = overslept.clone();
- demoted.handoffs[100].pri = 31;
+ demoted.handoffs[100].pri = sched::REALTIME_PRIORITY - 1;
assert!(source_scheduling(&demoted, reference, window).is_err());
assert!(source_scheduling(&overslept, reference, window).is_ok());
}
#[test]
+#[cfg_attr(
+ not(target_os = "macos"),
+ ignore = "its expected class is a macOS expectation (recording/instant/screen-mic-system sync-screen-mic)"
+)]
fn sentinel_freezes_excuse_only_failures_localized_inside_them() {
let reference = host_now();
// A sentinel log with a 300 ms gap at 9.9 s and a 60 ms gap at 5 s.