Goal. Under the thread_attrs cargo feature on
target_os = "linux", the ThreadAttributes::priority
setter and the worker thread’s set_sched_fifo call site
compile and run as part of the worker startup path. Behavioural
verification of the SCHED_FIFO policy actually taking
effect requires CAP_SYS_NICE, which the test host typically
lacks; set_sched_fifo swallows the EPERM and the worker
continues under SCHED_OTHER — see the audit note on
REQ_0041.
Fixture. crates/taktora-executor/tests/thread_attrs.rs
— worker_attrs_compiles_and_runs (lines 7-29) exercises
the worker_attrs path on which set_sched_fifo is
conditionally called.
Steps.
Build a ThreadAttributes value (the type carries the
priority field even when the test does not set it).
Build the executor with the attributes; register one
cyclic item.
Call exec.run_n(1).
Expected outcome. The build, executor construction, and
dispatch all succeed — exercising the compile-time presence
of the priority field and the
set_sched_fifo call site. Mechanical verification that
the policy is honoured requires running the host with
CAP_SYS_NICE (out of scope for unprivileged CI).
|