Skip to content

test: add backpressure policy coverage - #71

Merged
LimiNode merged 18 commits into
mainfrom
codex/add-tests-for-back-pressure-policies
Sep 18, 2025
Merged

test: add backpressure policy coverage#71
LimiNode merged 18 commits into
mainfrom
codex/add-tests-for-back-pressure-policies

Conversation

@LimiNode

Copy link
Copy Markdown
Owner

Summary

  • add burst-traffic regression test covering block and drop queue policies including drop counter checks
  • exercise multi-producer submission to validate queue saturation behavior and drop accounting
  • tag the backpressure test with a TSAN label so sanitizer jobs pick it up
  • add ordering regression to ensure MPSC workers preserve per-producer sequencing under load
  • introduce an SPSC-only test target that builds without the ring buffer to verify FIFO ordering
  • make the test glob auto-refresh on new sources and document queue-control helpers for future scenarios

Testing

  • cmake -S . -B build (fails: TimeShield dependency is not present in the environment)

https://chatgpt.com/codex/tasks/task_e_68ca24ff365c832c85510ad9209d0e17

Add configure_depends to the test glob so new unit test sources are discovered without rerunning configuration and add a short guide describing the queue back-pressure macros and drop counter helpers.
Replace the MPSC block-path timeout with a true wait loop so producers no longer fall through to the drop counter when the ring stays full. Relax the drop assertions in the burst regression to require sustained pressure without assuming an exact discard budget.
Ensure cancelling slow-path requests keeps drop counters balanced and extend policy regression to catch mismatched drop totals.
Allow the single- and multi-producer helpers to hold the consumer gate for a deterministic delay and apply that hold to the drop policy runs so the queues saturate reliably.
Allow a small tolerance when asserting the block-policy publish duration so the macOS TSAN job accounts for scheduler jitter.
Describe the mandatory git submodule update step so TimeShield and other embedded dependencies are available before running tests.
Ensure the lock-free executor removes one queued task when DropOldest\ntriggers, reinitialise the ring after max-size updates, and make the block\npolicy gating more resilient.
Delay MPSC publishers whenever the active task count reaches the configured queue limit and wake them as workers finish so the block policy provides real back-pressure instead of draining immediately on macOS.
Ensure the MPSC TaskExecutor removes overflowed work only from the worker thread and wakes blocked producers when capacity frees up, restoring deterministic ordering under DropOldest.
@LimiNode
LimiNode merged commit 7432dc3 into main Sep 18, 2025
10 checks passed
@LimiNode
LimiNode deleted the codex/add-tests-for-back-pressure-policies branch September 20, 2025 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant