[pr-tests] darner-core logging: unit tests for the async queue, flush and filter fallback #316
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!316
Loading…
Reference in a new issue
No description provided.
Delete branch "elgibbone/logging-async-queue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What it changes
Factors the queue counters, the writer loop, the filter choice and the sync switch into small helpers that can be tested without the global logger, with no change in behaviour, and adds six tests: lines reach console and file in order; a full queue drops without blocking and reports the count on both outputs; a disconnected receiver rolls back the queued count so flush does not wait; flush waits for pending lines and stops at its timeout; DARNER_LOG wins over RUST_LOG and bad syntax uses the default; sync mode is on only for 1.
How it was tested
a38a8e3cargo test -p darner-core --locked: 39 passed, 0 failedcargo clippy -p darner-core --all-targets --locked -- -D warnings, and with--all-features: cleancargo xwin clippy --target x86_64-pc-windows-msvc: cleancargo xtask policy: 555 files okcargo test --offline --locked -p darner-core --lib logging::testsona38a8e3: all six passed;cargo xtask policypassed (comment below).Checklist
main.docs/asset-policy.md.Checked for overlap
The disconnected-receiver test can fail on a loaded runner even when the rollback works. Its 50 ms wall-clock limit also counts any time the OS deschedules the test thread. The queued-count assertion already catches a failed rollback. Consider using that invariant for this test and keeping the separate pending-line test for the wait behavior.
Thanks, good point. Pushed
a38a8e3: the test now asserts that written == queued (both 0 after the rollback), which is exactly the condition flush waits on, instead of timing it. flush_waits_for_pending_lines_and_stops_at_the_timeout still covers the wait. Ona38a8e3, on macOS (aarch64):cargo test -p darner-core --locked39 passed; both clippy gates on darner-core clean for the host and forx86_64-pc-windows-msvc(cargo-xwin).I tested
a38a8e3on Windows. All six logging tests passed withcargo test --offline --locked -p darner-core --lib logging::tests, including the rollback and bounded-flush cases.cargo xtask policyalso passed.Add unit tests for async logging queue, flush and filter fallbackto [pr-tests] darner-core logging: unit tests for the async queue, flush and filter fallback