Repository navigation
audiopump.Ring: prove an underrun is silence and a count, and an overrun a short write - #335
Merged
Merged
Conversation
…run a short write Two cases in route_probe.py, on CPython and MicroPython alike. A ring holding a block and a half, pulled for three, gives the block, then two blocks of silence and two underruns, and keeps the half block for the next pull. A producer that offers its remainder again after a short write pushes six blocks through a ring two blocks deep with nothing lost, and each short write is counted. Each case has a planted fault in CI that must fail.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A stream pushed from a network arrives late and in lumps, so the two things a Ring promises when its producer can't keep up are worth pinning on every runtime:
underruncase queues 1.5 blocks, pulls 3, and checks the first block, two blocks of silence, two underruns, 512 bytes held, then the rest in order after a top-up.overruncase pushes six blocks through a ring two blocks deep.Both run in
tests/pump/route_probe.pyon CPython and on the MicroPython unix build, with the same digests on both. Each has a planted fault (--fault drop) added to the CI lists intest-cpython.ymlandclean-build.yml; locally each one fails as it should.No library code changes.