The scheduling brain, built against CORE's headers (vdm/engine.hpp,
vdm/segment/budget.hpp) — signatures only; the Engine bodies land in
CORE stage 8 and the Scheduler that wires governor <-> store <-> engine
<-> timer comes after that (daemon/docs/deferrals.md D4).
- sched/governor — a pure decision function. In: a snapshot of every
task's coarse RunState and every queue's state (schedule windows
pre-resolved). Out: {to_start, to_resume, to_pause, pause_reasons,
priority_order}. Enforces, all in TASK units per ADR 0011 §1:
connection.maxConcurrentDownloads; the min(that, maxActiveSegments)
clamp (§2); Queue.maxConcurrent; the per-host task cap (§4); and a
stopped queue / closed window runs nothing. Never touches a task
paused for `user` or CORE's `auto` (ADR 0013 §3) — only Schedule /
QueueStopped / AdmissionReconcile are auto-resumable. Deterministic:
main-list before queued-in-queue, then queue order, then FIFO, then
task_id.
- sched/schedule_window — window_open(Schedule, local tm): disabled =>
always open; `once` => date + time match; `periodic` => weekday in
daysOfWeek (empty = every day) + time in [start, stop); null start =>
midnight, null stop => end of day, stop < start => overnight window.
Pure; re-evaluated every tick, no cached instants.
- veloxd_sched static lib; veloxd links it (nothing calls it yet).
Tests (ASan+UBSan and TSan clean): veloxd.sched_window (10 window
cases incl. overnight, once, null bounds), veloxd.sched_governor
(global/clamp/per-queue/per-host caps, stop vs window pause reasons,
resume-only-governor-reasons, auth-pause untouched, admission
reconcile, determinism under shuffled input). 32 daemon/cli tests
green; full tree green.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Upd9WhG9oppieig5nRDLig
21 lines
985 B
CMake
21 lines
985 B
CMake
# daemon unit + integration tests. Registered with ctest; run via `ctest --preset dev`.
|
|
# No external test framework — each file is a small self-checking binary.
|
|
|
|
function(veloxd_test name)
|
|
cmake_parse_arguments(T "" "" "LIBS" ${ARGN})
|
|
add_executable(veloxd_${name}_test ${name}_test.cpp)
|
|
target_link_libraries(veloxd_${name}_test PRIVATE ${T_LIBS})
|
|
target_compile_options(veloxd_${name}_test PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
|
add_test(NAME veloxd.${name} COMMAND veloxd_${name}_test)
|
|
set_tests_properties(veloxd.${name} PROPERTIES TIMEOUT 30)
|
|
endfunction()
|
|
|
|
veloxd_test(ndjson LIBS veloxd_rpc)
|
|
veloxd_test(uds_roundtrip LIBS veloxd_rpc)
|
|
veloxd_test(store_migrations LIBS veloxd_store)
|
|
veloxd_test(pairings LIBS veloxd_store veloxd_rpc)
|
|
veloxd_test(ws_frame LIBS veloxd_rpc)
|
|
veloxd_test(ws_server LIBS veloxd_rpc)
|
|
veloxd_test(sched_window LIBS veloxd_sched)
|
|
veloxd_test(sched_governor LIBS veloxd_sched)
|