Skip to content
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

test: Fix a tests that could fail via a race condition #573

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

brandonocasey
Copy link
Contributor

Description

Sometimes this test fails on Firefox, because audio is appended to the audio buffer, before video, even though we call appendBuffer on video first. This causes the test to end without running the video appendBuffer callback and we get one less assertion than we expect.

@@ -810,7 +810,7 @@ function(assert) {

QUnit.test('setDuration blocks audio and video queue entries until it finishes',
function(assert) {
const done = assert.async();
const done = assert.async(2);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait for two done calls, one from the video appendBuffer and one from the audio appendBuffer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a thing? Neat.

@brandonocasey brandonocasey merged commit 47ff715 into master Jun 27, 2019
@brandonocasey brandonocasey deleted the tests/race-condition-failure branch June 27, 2019 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants