Skip to content

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

Merged

Conversation

docEdub
Copy link
Contributor

@docEdub docEdub commented Apr 11, 2025

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.

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.
Copy link
Contributor

@Copilot Copilot AI left a 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) {

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@docEdub docEdub enabled auto-merge (squash) April 11, 2025 07:12
@docEdub docEdub disabled auto-merge April 11, 2025 07:12
@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@docEdub docEdub merged commit f5261fa into BabylonJS:master Apr 11, 2025
17 checks passed
@docEdub docEdub deleted the 250411-fix-flaky-playwright-audio-tests branch April 11, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants