New issue
Advanced search Search tips

Issue 819924 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 831327
Owner:
Closed: Aug 22
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 1
Type: Bug



Sign in to add a comment

"WebMediaPlayerMSTest.CreateHardwareFrames" is flaky

Project Member Reported by chromium...@appspot.gserviceaccount.com, Mar 8 2018

Issue description

"WebMediaPlayerMSTest.CreateHardwareFrames" is flaky.

This issue was created automatically by the chromium-try-flakes app. Please find the right owner to fix the respective test/step and assign this issue to them. If the step/test is infrastructure-related, please add Infra-Troopers label and change issue status to Untriaged. When done, please remove the issue from Sheriff Bug Queue by removing the Sheriff-Chromium label.

We have detected 4 recent flakes. List of all flakes can be found at https://chromium-try-flakes.appspot.com/all_flake_occurrences?key=ahVzfmNocm9taXVtLXRyeS1mbGFrZXNyNAsSBUZsYWtlIilXZWJNZWRpYVBsYXllck1TVGVzdC5DcmVhdGVIYXJkd2FyZUZyYW1lcww.

Flaky tests should be disabled within 30 minutes unless culprit CL is found and reverted. Please see more details here: https://sites.google.com/a/chromium.org/dev/developers/tree-sheriffs/sheriffing-bug-queues#triaging-auto-filed-flakiness-bugs
 
Components: Blink>GetUserMedia
Labels: -Sheriff-Chromium OS-Fuchsia
Project Member

Comment 2 by chromium...@appspot.gserviceaccount.com, Mar 12 2018

Labels: Sheriff-Chromium
Detected 3 new flakes for test/step "WebMediaPlayerMSTest.CreateHardwareFrames". To see the actual flakes, please visit https://chromium-try-flakes.appspot.com/all_flake_occurrences?key=ahVzfmNocm9taXVtLXRyeS1mbGFrZXNyNAsSBUZsYWtlIilXZWJNZWRpYVBsYXllck1TVGVzdC5DcmVhdGVIYXJkd2FyZUZyYW1lcww. This message was posted automatically by the chromium-try-flakes app. Since flakiness is ongoing, the issue was moved back into Sheriff Bug Queue (unless already there).

Comment 3 by tapted@chromium.org, Mar 13 2018

[ RUN      ] WebMediaPlayerMSTest.CreateHardwareFrames
[233263:1394281871:0312/225157.871864:335304965:ERROR:base_paths_fuchsia.cc(37)] Not implemented reached in bool base::PathProviderFuchsia(int, base::FilePath *)
../../content/renderer/media/stream/webmediaplayer_ms_unittest.cc:1075: Failure
Actual function call count doesn't match EXPECT_CALL(*this, DoStartRendering())...
         Expected: to be called once
           Actual: never called - unsatisfied and active
../../content/renderer/media/stream/webmediaplayer_ms_unittest.cc:1074: Failure
Actual function call count doesn't match EXPECT_CALL(*this, DoSetWebLayer(true))...
         Expected: to be called once
           Actual: never called - unsatisfied and active
../../content/renderer/media/stream/webmediaplayer_ms_unittest.cc:1077: Failure
Actual function call count doesn't match EXPECT_CALL(*this, DoReadyStateChanged( blink::WebMediaPlayer::kReadyStateHaveMetadata))...
         Expected: to be called once
           Actual: never called - unsatisfied and active
../../content/renderer/media/stream/webmediaplayer_ms_unittest.cc:1079: Failure
Actual function call count doesn't match EXPECT_CALL(*this, DoReadyStateChanged( blink::WebMediaPlayer::kReadyStateHaveEnoughData))...
         Expected: to be called once
           Actual: never called - unsatisfied and active
../../content/renderer/media/stream/webmediaplayer_ms_unittest.cc:1081: Failure
Actual function call count doesn't match EXPECT_CALL(*this, CheckSizeChanged(gfx::Size(kStandardWidth, kStandardHeight)))...
         Expected: to be called once
           Actual: never called - unsatisfied and active
../../content/renderer/media/stream/webmediaplayer_ms_unittest.cc:1091: Failure
Actual function call count doesn't match EXPECT_CALL(*this, DoStopRendering())...
         Expected: to be called once
           Actual: never called - unsatisfied and active
[  FAILED  ] WebMediaPlayerMSTest.CreateHardwareFrames (230 ms

Comment 4 by tapted@chromium.org, Mar 13 2018

Cc: w...@chromium.org
Labels: -Sheriff-Chromium
Owner: scottmg@chromium.org
Status: Assigned (was: Untriaged)
disabling on fuscia^H^H^H^H^H^Hpink in https://chromium-review.googlesource.com/#/c/chromium/src/+/958666

Comment 5 by tapted@chromium.org, Mar 13 2018

(scottmg: I picked you in case this is related to Issue 766356)

Comment 6 by w...@chromium.org, Mar 13 2018

Cc: sergeyu@chromium.org
Components: Internals>PlatformIntegration
Labels: M-67
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3f0e87ea2bf994888abfc988abc7d2587bc60d2

commit a3f0e87ea2bf994888abfc988abc7d2587bc60d2
Author: Trent Apted <tapted@chromium.org>
Date: Tue Mar 13 03:49:47 2018

Disable WebMediaPlayerMSTest.CreateHardwareFrames on Fushsia

Flaky.

TBR=scottmg@chromium.org

Bug:  819924 
Change-Id: Id6a337392ec94bbc1b3ae2f83a914bc4d2565996
Reviewed-on: https://chromium-review.googlesource.com/958666
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542722}
[modify] https://crrev.com/a3f0e87ea2bf994888abfc988abc7d2587bc60d2/testing/buildbot/filters/fuchsia.content_unittests.filter

Comment 8 by w...@chromium.org, Mar 14 2018

WebMediaPlayerMSTest.StopsCreatingHardwareFramesWhenHiddenOrClosed  failed in https://build.chromium.org/p/chromium.fyi/builders/Fuchsia/builds/14779 with a crash:

[00332.786] 01197.01240> <== general fault, PC at 0x552e4c0e4907
...
#01: content::MockMediaStreamVideoRenderer::InjectFrame() at ??:?
#02: base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) at ??:?
#03: base::MessageLoop::RunTask(base::PendingTask*) at ??:?
#04: base::MessageLoop::DoDelayedWork(base::TimeTicks*) at ??:?
#05: base::MessagePumpDefault::Run(base::MessagePump::Delegate*) at ??:?
#06: base::RunLoop::RunUntilIdle() at ??:?
#07: content::WebMediaPlayerMSTest::~WebMediaPlayerMSTest() at ??:?
#08: content::WebMediaPlayerMSTest_OpacityChange_Test::~WebMediaPlayerMSTest_OpacityChange_Test() at ??:?
#09: testing::TestInfo::Run() at ??:?
#10: testing::TestCase::Run() at ??:?
#11: testing::internal::UnitTestImpl::RunAllTests() at ??:?
#12: testing::UnitTest::Run() at ??:?
#13: base::TestSuite::Run() at ??:?
#14: base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) at ??:?
#15: base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) at ??:?
#16: main at ??:?
#17: pc 0x59e1984f661e sp 0x147ec5a55fe0 (libc.so,0x1361e)
#18: pc 0 sp 0x147ec5a56000

Will broaden the suppression for this test suite.
Project Member

Comment 9 by bugdroid1@chromium.org, Mar 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/00eae0d98fb6a1f83aeaa901b080f7543d43318d

commit 00eae0d98fb6a1f83aeaa901b080f7543d43318d
Author: Wez <wez@chromium.org>
Date: Wed Mar 14 01:43:55 2018

Filter a new WebMediaPlayerMSTest test under Fuchsia.

The new StopsCreatingHardwareFramesWhenHiddenOrClosed crashes under
Fuchsia, so filter it for now.

TBR: sergeyu
Bug:  819924 
Change-Id: Iecec7d2dae681af105e2c9adde84e120343317bd
Reviewed-on: https://chromium-review.googlesource.com/961735
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542981}
[modify] https://crrev.com/00eae0d98fb6a1f83aeaa901b080f7543d43318d/testing/buildbot/filters/fuchsia.content_unittests.filter

Comment 10 by w...@chromium.org, Mar 22 2018

Cc: scottmg@chromium.org
Owner: w...@chromium.org
WebMediaPlayerMSTest.RotationChange failed in https://ci.chromium.org/buildbot/chromium.fyi/Fuchsia/15151 with the following:

[00328.633] 01201.01235> <== fatal exception: process content_unittests__exec[224715] thread initial-thread[224778]
...
#01: content::MockMediaStreamVideoRenderer::InjectFrame() at ??:?
#02: base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) at ??:?
#03: base::MessageLoop::RunTask(base::PendingTask*) at ??:?
#04: base::MessageLoop::DoDelayedWork(base::TimeTicks*) at ??:?
#05: base::MessagePumpDefault::Run(base::MessagePump::Delegate*) at ??:?
#06: base::RunLoop::RunUntilIdle() at ??:?
#07: content::WebMediaPlayerMSTest::~WebMediaPlayerMSTest() at ??:?
#08: content::WebMediaPlayerMSTest_OpacityChange_Test::~WebMediaPlayerMSTest_OpacityChange_Test() at ??:?
#09: testing::TestInfo::Run() at ??:?
#10: testing::TestCase::Run() at ??:?
#11: testing::internal::UnitTestImpl::RunAllTests() at ??:?
#12: testing::UnitTest::Run() at ??:?
#13: base::TestSuite::Run() at ??:?
#14: base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) at ??:?
#15: base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) at ??:?
#16: main at ??:?
#17: pc 0x40cf83c8d66e sp 0x61666bc2cfe0 (libc.so,0x1366e)
#18: pc 0 sp 0x61666bc2d000

Notice that both stacks take place during teardown of the OpacityChange test; the crash may be getting mis-attributed by the TestLauncher e.g. due to truncated output from the crashing batch process.

Comment 11 by w...@chromium.org, Mar 23 2018

Status: Started (was: Assigned)
The InjectFrame() function injects a frame and then posts a delayed task to inject the next frame (see https://cs.chromium.org/chromium/src/content/renderer/media/stream/webmediaplayer_ms_unittest.cc?l=349). The posted task uses base::Unretained(). It's not clear whether that is intentional; the class itself is ref-counted, but Unretained() avoids the test itself affecting the ref-counting of implementation code.  Some of the tests have a pending delayed task when they exit (i.e. they have scheduled more frames to be injected than the test actually waits for) - the tests only pass (most of the time) because the delayed task is silently dropped when the test instance' message queue is torn down.

Applying a simple Sleep() during the test teardown can provoke this crash under other platforms, e.g. Linux:

--- a/content/renderer/media/stream/webmediaplayer_ms_unittest.cc
+++ b/content/renderer/media/stream/webmediaplayer_ms_unittest.cc
@@ -469,6 +469,7 @@ class WebMediaPlayerMSTest
         rendering_(false),
         background_rendering_(false) {}
   ~WebMediaPlayerMSTest() override {
+    base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(500));
     player_.reset();
     base::RunLoop().RunUntilIdle();
   }

This appears to affect the RotationChange, OpacityChange and StopsCreatingHardwareFramesWhenHiddenOrClosed tests.

Comment 12 by w...@chromium.org, Mar 23 2018

Cc: emir...@chromium.org
Project Member

Comment 13 by bugdroid1@chromium.org, Mar 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/33d4d98b9d6ff6b6be10fb414bda6e3b20d118d3

commit 33d4d98b9d6ff6b6be10fb414bda6e3b20d118d3
Author: Wez <wez@chromium.org>
Date: Fri Mar 23 19:45:16 2018

Fix WebMediaPlayerMSTest.* not to use-after-free on slow systems.

These tests were posting delayed tasks to inject video frames, with raw
pointers to the target object. The tests would usually pass because the
delayed task would be silently dropped during MessageLoop teardown, but
on slow systems (e.g. under QEMU) these delayed tasks could end up
being executed during the teardown RunUntilIdle(), after the target
had been torn down.

The target is a ref-counted object, so post delayed tasks to it without
using Unretained(), to ensure it remains valid.

Bug:  819924 
Change-Id: I5a781cbaab1519b5707967753decf2672ba826d5
Reviewed-on: https://chromium-review.googlesource.com/978637
Reviewed-by: Emircan Uysaler <emircan@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545559}
[modify] https://crrev.com/33d4d98b9d6ff6b6be10fb414bda6e3b20d118d3/content/renderer/media/stream/webmediaplayer_ms_unittest.cc
[modify] https://crrev.com/33d4d98b9d6ff6b6be10fb414bda6e3b20d118d3/testing/buildbot/filters/fuchsia.content_unittests.filter

Comment 14 by w...@chromium.org, Mar 23 2018

Status: Fixed (was: Started)
Status: Assigned (was: Fixed)
Flaked again in https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/fuchsia-fyi-arm64-rel/496 with:

[ RUN      ] WebMediaPlayerMSTest.CreateHardwareFrames
../../content/renderer/media/stream/webmediaplayer_ms_unittest.cc:1137: Failure
Value of: frame != nullptr
  Actual: false
Expected: true
Stack trace:
#00: testing::internal::AssertHelper::operator=(testing::Message const&) const at gtest.cc:?
#01: content::WebMediaPlayerMSTest_CreateHardwareFrames_Test::TestBody() at webmediaplayer_ms_unittest.cc:?

The test runs in 175ms, so this doesn't look like a timeout issue.
Labels: -M-67 M-70
Owner: emir...@chromium.org
emircan: Under what circumstances would we get the assertion in #15 failing?
Flaked again, in https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/fuchsia-fyi-arm64-rel/578 with:

[ RUN      ] WebMediaPlayerMSTest.CreateHardwareFrames
../../content/renderer/media/stream/webmediaplayer_ms_unittest.cc:1131: Failure
Actual function call count doesn't match EXPECT_CALL(*this, CheckSizeChanged(provider->get_standard_size()))...
         Expected: to be called once
           Actual: never called - unsatisfied and active
Stack trace:
#00: testing::internal::AssertHelper::operator=(testing::Message const&) const at gtest.cc:?
#01: testing::internal::GoogleTestFailureReporter::ReportFailure(testing::internal::FailureReporterInterface::FailureType, char const*, int, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char> > const&) at gmock-internal-utils.cc:?
#02: testing::internal::UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked() at gmock-spec-builders.cc:?
#03: testing::Mock::VerifyAndClearExpectationsLocked(void*) at gmock-spec-builders.cc:?
#04: testing::Mock::VerifyAndClearExpectations(void*) at gmock-spec-builders.cc:?
#05: content::WebMediaPlayerMSTest_CreateHardwareFrames_Test::TestBody() at webmediaplayer_ms_unittest.cc:?

[  FAILED  ] WebMediaPlayerMSTest.CreateHardwareFrames (279 ms)
Mergedinto: 831327
Status: Duplicate (was: Assigned)

Sign in to add a comment