-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix flaky playwright audio tests #16478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flaky playwright audio tests #16478
Conversation
The playwright audio tests expecting volume curve values are flaky because the volume curve analysis algorithm is leaving a zero volume gap sample between each pulse. If the time the volume is checked at falls on that gap, the test fails. This change fixes the issue by removing the gap in the volume curve and writing the average volume sample values across the entire span of the pulse without skipping a sample between pulses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
packages/tools/tests/test/audioV2/utils/audioEngineV2.utils.ts:113
- [nitpick] Consider renaming the parameter 'iPulseEnd' to 'pulseEnd' for improved clarity and to better reflect its purpose.
const updateCurve = (iPulseEnd: number) => {
packages/tools/tests/test/audioV2/utils/audioEngineV2.utils.ts:130
- [nitpick] To avoid any ambiguity with operator precedence, consider adding parentheses around 'samples[i] > 0' to make the intent clear, e.g. 'if (currentPolarity !== (samples[i] > 0)) {'.
if (currentPolarity !== samples[i] > 0) {
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16478/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/16478/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/16478/merge#BCU1XR#0 |
WebGL2 visualization test reporter: |
Visualization tests for WebGPU |
The playwright audio tests expecting volume curve values are flaky because the volume curve analysis algorithm is leaving a zero volume gap sample between each pulse. If the time the volume is checked at falls on that gap, the test fails.
This change fixes the issue by removing the gap in the volume curve and writing the average volume sample values across the entire span of the pulse without skipping a sample between pulses.