Repository navigation
test(cvcgl_media_audio): drain frames until each program has run - #855
Merged
Merged
Conversation
The test ran one rt.drain() after setting each tick program and then asserted the program had finished. A drain pumps the app scheduler for a bounded slice (0.1 s, its second half on the thread's CPU clock), and a program that needs more carries on in the next frame's drain, by design. In package-linux's Debug lanes, which build with coverage instrumentation, the deep-graph program (a 64-level mix/gain graph, two stream-opens) can need more than one slice on a loaded runner: "the deep-graph program ran" failed on all 3 attempts in #834's run 40494020761 (job 122154778441) and on 1 attempt in master 83b6020's debug-grpc job; in the runs checked, only in Debug lanes. The test now drains until the program has set its key, for 10 s at most, and prints how many drains that took when it was more than one.
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.
cvcgl_media_audioaborts now and then on package-linux's Debug lanes:It failed all 3 attempts in #834's run 40494020761 (
package-linux / libcvc-debug, job 122154778441), and 1 attempt in master 83b6020'spackage-linux / libcvc-debug-grpc(job 122277740072). It passed on the next run of #834. #834 adds only benchmark files, so this is not its code. In the runs checked, it failed only in Debug lanes.Root cause
The test sets a tick program, calls
rt.drain()once, and asserts the program finished. A drain doesn't promise that.Runtime::drain()pumps the app scheduler for a bounded slice (kPumpMaxSteps200,000,kPumpMaxSeconds0.1 s, atime_budgetwhose second half is on the thread's CPU clock). A program that needs more goes on in the next frame's drain, by design. The deep-graph program builds a 64-level mix/gain graph and opens two streams. The Debug lanes build with coverage instrumentation, and on a loaded runner that program can need more than one slice. No warning is printed because nothing failed: the program was still running.This is the mechanism the code shows. I have not reproduced the failure locally (this box has no Debug coverage build), so the test now prints how many drains a program took when it was more than one. A later failure will show whether that was the cause.
Fix
The test drains frames until each program has set its key (
cap.done,deep.done), for 10 s at most, then asserts as before. The programs already guard against re-running once their key is set.Evidence
cvcgl_media_audiopasses 3/3, each program finishing in its first drain.deep.donewas unset, which is exactly where the old single-drain test aborted.ci/full/package-lanes(40615210987) was still queued. The failure was intermittent, so a green run alone is weak evidence; a future slow run now prints "deep.done after N drains" instead of aborting.