New issue
Advanced search Search tips

Issue 759245 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug

Blocking:
issue 882906
issue 754861



Sign in to add a comment

Many content_unittests tests reliably fail if run with a high batch-limit, seemingly due to TaskScheduler resources leaked by earlier tests.

Project Member Reported by w...@chromium.org, Aug 25 2017

Issue description

Running content_unittests with --single-process-tests, or --test-launcher-batch-limit=100 results in:

For example:

[----------] 16 tests from OneShotAccessibilityTreeSearchTest
[ RUN      ] OneShotAccessibilityTreeSearchTest.GetAll
[       OK ] OneShotAccessibilityTreeSearchTest.GetAll (3 ms)
[ RUN      ] OneShotAccessibilityTreeSearchTest.NoCycle
[29602:29602:0825/165501.661210:2185169553453:FATAL:task_scheduler_impl.cc(45)] Check failed: join_for_testing_returned_.IsSet(). 
#0 0x7f9669c2e74d base::debug::StackTrace::StackTrace()
#1 0x7f9669c2cb1c base::debug::StackTrace::StackTrace()
#2 0x7f9669cbd07a logging::LogMessage::~LogMessage()
#3 0x7f9669e36a4d base::internal::TaskSchedulerImpl::~TaskSchedulerImpl()
#4 0x7f9669e36d59 base::internal::TaskSchedulerImpl::~TaskSchedulerImpl()
#5 0x7f9669e35cfe base::TaskScheduler::SetInstance()
#6 0x7f9669e35b1e base::TaskScheduler::Create()
#7 0x7f9669e355ee base::TaskScheduler::CreateAndStartWithDefaultParams()
#8 0x0000006f66ed content::OneShotAccessibilityTreeSearchTest::SetUp()
#9 0x00000127c80e _ZN7testing8internal12InvokeHelperIdNSt3__15tupleIJEEEE12InvokeMethodIN5media23VirtualAudioInputStreamEMS8_FdvEEEdPT_T0_RKS4_
#10 0x000002556152 testing::internal::HandleExceptionsInMethodIfSupported<>()
#11 0x000002540cd4 testing::Test::Run()
#12 0x00000254187d testing::TestInfo::Run()
#13 0x0000025422dc testing::TestCase::Run()
#14 0x00000254df0c testing::internal::UnitTestImpl::RunAllTests()
#15 0x00000127ba8e _ZN7testing8internal12InvokeHelperIbNSt3__15tupleIJEEEE12InvokeMethodIN5media23VirtualAudioInputStreamEMS8_FbvEEEbPT_T0_RKS4_
#16 0x000002557692 testing::internal::HandleExceptionsInMethodIfSupported<>()
#17 0x00000254db4a testing::UnitTest::Run()
#18 0x000002e39311 RUN_ALL_TESTS()
#19 0x000002e36dee base::TestSuite::Run()
#20 0x000002d9a89d content::UnitTestTestSuite::Run()
#21 0x00000079fdad _ZN4base8internal13FunctorTraitsIMN7content26AppCacheRequestHandlerTestEFvvEvE6InvokeIPS3_JEEEvS5_OT_DpOT0_
#22 0x00000079fcf4 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIMN7content26AppCacheRequestHandlerTestEFvvEJPS5_EEEvOT_DpOT0_
#23 0x00000202f4a5 _ZN4base8internal7InvokerINS0_9BindStateIMN7content17UnitTestTestSuiteEFivEJNS0_17UnretainedWrapperIS4_EEEEEFivEE7RunImplIRKS6_RKNSt3__15tupleIJS8_EEEJLm0EEEEiOT_OT0_NSF_16integer_sequenceImJXspT1_EEEE
#24 0x00000202f3ec _ZN4base8internal7InvokerINS0_9BindStateIMN7content17UnitTestTestSuiteEFivEJNS0_17UnretainedWrapperIS4_EEEEEFivEE3RunEPNS0_13BindStateBaseE
#25 0x0000007be99d _ZNKR4base8CallbackIFvvELNS_8internal8CopyModeE1ELNS2_10RepeatModeE1EE3RunEv
#26 0x000002e58937 base::(anonymous namespace)::LaunchUnitTestsInternal()
#27 0x000002e587a5 base::LaunchUnitTests()
#28 0x00000202f293 main
#29 0x7f9658e54f45 __libc_start_main

 
Cc: -scottmg@chromium.org
Owner: scottmg@chromium.org
Status: Assigned (was: Untriaged)
I had disabled most of the other OneShotAccessibilityTreeSearchTest, but maybe I should have used wildcards :/. I think this is yet another TaskScheduler problem so I can take a look.
Blocking: 754861
(Ahem, as you had tagged it. Well.)
Tom Smykowski: "I take the old code, and I delete it. And then I add a ScopedTaskEnvironment." https://chromium-review.googlesource.com/c/chromium/src/+/636086


Project Member

Comment 4 by bugdroid1@chromium.org, Aug 28 2017

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

commit ce4114e91772f4864307481d681110ec2606ae8f
Author: Scott Graham <scottmg@chromium.org>
Date: Mon Aug 28 07:33:46 2017

Fix creation of TaskScheduler in OneShotAccessibilityTreeSearchTest

The previous creation of TaskScheduler didn't work with other tests in
the same batch using ScopedTaskEnvironment because it wasn't tearing
down its created instance. Instead of fixing that, switch to using
ScopedTaskEnvironment as this fixture doesn't have any special
requirements.

This showed up as flake on Fuchsia, but is cross-platform.

Bug:  759245 ,  754861 
Change-Id: I21b3121a7f971064efa82d352071cce0ae29629b
Reviewed-on: https://chromium-review.googlesource.com/636086
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497704}
[modify] https://crrev.com/ce4114e91772f4864307481d681110ec2606ae8f/content/browser/accessibility/one_shot_accessibility_tree_search_unittest.cc
[modify] https://crrev.com/ce4114e91772f4864307481d681110ec2606ae8f/testing/buildbot/filters/fuchsia.content_unittests.filter

Comment 5 by gab@chromium.org, Aug 28 2017

Did that fix it? Unit tests sure shouldn't create their own unscoped
TaskScheduler... And AFAIK error messages in post_task.cc and documentation
in relevant headers are fairly clear about that. But we should make it even
clearer if many people make this mistake..
Status: Fixed (was: Assigned)
Yes, but I assume from the way the code was written the test probably predated the help or even ScopedTaskEnvironment? Not sure. 
Blocking: 882906

Sign in to add a comment