Flaky AutocompleteActionPredictorTest |
|||
Issue descriptionSome of the AutocompleteActionPredictorTest tests are flaking, see https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=unit_tests&tests=AutocompleteActionPredictorTest Looking for likely culprits, it seems like my change, along with alexilin@'s change, happened very recently, see https://chromium.googlesource.com/chromium/src/+log/95bab29803f610d9e3cb14abe4e6e81086dcbc8e/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc However, I think I've found a build from before my change, that makes me suspect alexilin@'s change. https://build.chromium.org/p/client.v8.chromium/builders/Linux%20-%20Future%20(dbg)/builds/3784 https://build.chromium.org/p/client.v8.chromium/builders/Linux%20-%20Future%20(dbg)/builds/3784/steps/unit_tests/logs/stdio Example stacktrace [ RUN ] AutocompleteActionPredictorTest.RecommendActionURL [5000:5227:0816/084656.096558:5706216784:ERROR:connection.cc(1964)] Predictor sqlite error 1802, errno 0: disk I/O error, sql: INSERT INTO network_action_predictor (id, user_text, url, number_of_hits, number_of_misses) VALUES (?,?,?,?,?) [5000:5227:0816/084656.096773:5706216895:FATAL:connection.cc(1979)] disk I/O error #0 0x7efd04c2126d base::debug::StackTrace::StackTrace() #1 0x7efd04c1f63c base::debug::StackTrace::StackTrace() #2 0x7efd04cafb8a logging::LogMessage::~LogMessage() #3 0x7efcfc08ebef sql::Connection::OnSqliteError() #4 0x7efcfc0aa4c5 sql::Statement::CheckError() #5 0x7efcfc0aa407 sql::Statement::StepInternal() #6 0x7efcfc0aa5ae sql::Statement::Run() #7 0x00000553e4fc predictors::AutocompleteActionPredictorTable::AddAndUpdateRows() #8 0x0000055398ff _ZN4base8internal13FunctorTraitsIMN10predictors32AutocompleteActionPredictorTableEFvRKNSt3__16vectorINS3_3RowENS4_9allocatorIS6_EEEESB_EvE6InvokeI13scoped_refptrIS3_EJS9_S9_EEEvSD_OT_DpOT0_ #9 0x00000553985a _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIMN10predictors32AutocompleteActionPredictorTableEFvRKNSt3__16vectorINS5_3RowENS6_9allocatorIS8_EEEESD_EJ13scoped_refptrIS5_ESB_SB_EEEvOT_DpOT0_ #10 0x0000055397cd _ZN4base8internal7InvokerINS0_9BindStateIMN10predictors32AutocompleteActionPredictorTableEFvRKNSt3__16vectorINS4_3RowENS5_9allocatorIS7_EEEESC_EJ13scoped_refptrIS4_ESA_SA_EEEFvvEE7RunImplISE_NS5_5tupleIJSG_SA_SA_EEEJLm0ELm1ELm2EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEE #11 0x0000055396a9 _ZN4base8internal7InvokerINS0_9BindStateIMN10predictors32AutocompleteActionPredictorTableEFvRKNSt3__16vectorINS4_3RowENS5_9allocatorIS7_EEEESC_EJ13scoped_refptrIS4_ESA_SA_EEEFvvEE7RunOnceEPNS0_13BindStateBaseE #12 0x7efd04bcc7f1 _ZNO4base8CallbackIFvvELNS_8internal8CopyModeE0ELNS2_10RepeatModeE0EE3RunEv #13 0x7efd04c25eb7 base::debug::TaskAnnotator::RunTask() #14 0x7efd04e2ceb4 base::internal::TaskTracker::PerformRunTask() #15 0x7efd04e2efe6 base::internal::TaskTrackerPosix::PerformRunTask() #16 0x000004883f8d base::test::ScopedTaskEnvironment::TestTaskTracker::PerformRunTask() #17 0x7efd04e2b793 base::internal::TaskTracker::RunNextTask() #18 0x7efd04e1ad56 base::internal::SchedulerWorker::Thread::ThreadMain() #19 0x7efd04e3b121 base::(anonymous namespace)::ThreadFunc() #20 0x7efd08753184 start_thread #21 0x7efcef00cbed clone
,
Aug 16 2017
diff --git a/chrome/browser/predictors/autocomplete_action_predictor_table.cc b/chrome/browser/predictors/autocomplete_action_predictor_table.cc
index 49c01518c53e..492e11980582 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor_table.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor_table.cc
@@ -151,6 +151,8 @@ void AutocompleteActionPredictorTable::AddAndUpdateRows(
}
BindRowToStatement(*it, &statement);
+ LOG(ERROR) << "SKYM usleep(100000)";
+ usleep(100000);
if (!statement.Run()) {
DB()->RollbackTransaction();
return;
> out/Default/unit_tests --gtest_filter=AutocompleteActionPredictorTest.RecommendActionURL
Seems to crash 100% of the time. Reverting 9a16ee7a2e71c6a387def43c56583ad1bf5f41f8, fixing merge conflicts (I'm sorry!), and then re-running, it no longer crashes.
https://chromium.googlesource.com/chromium/src/+/9a16ee7a2e71c6a387def43c56583ad1bf5f41f8
,
Aug 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f7d1139a59fc8941a206cbda06d64b54dcc0d151 commit f7d1139a59fc8941a206cbda06d64b54dcc0d151 Author: Alexandr Ilin <alexilin@chromium.org> Date: Thu Aug 17 09:44:26 2017 predictors: Fix flaky AutocompleteActionPredictorTest AutocompleteActionPredictorTest uses default content::TestBrowserThreadBundle which means that all tasks posted to BrowserThread::DB are completed on the main test thread. After the migration https://crrev.com/c/616680 of the predictor database from the DB thread to a SequencedTaskRunner tasks are posted to the sequence that is executed in a separate thread. If the destruction of the test class happens before all tasks are executed in a separate thread, the test crashes. This CL blocks the main thread until all tasks are completed before the test is finished. Bug: 756234 Change-Id: Ia4efafb5ce54d0bc12e6945cc471fb41e07c272e Reviewed-on: https://chromium-review.googlesource.com/618569 Reviewed-by: Benoit L <lizeb@chromium.org> Commit-Queue: Alexandr Ilin <alexilin@chromium.org> Cr-Commit-Position: refs/heads/master@{#495119} [modify] https://crrev.com/f7d1139a59fc8941a206cbda06d64b54dcc0d151/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc
,
Aug 17 2017
Thank you for spotting the issue! The bug was indeed introduced by my change. Your repro also was super useful for finding the cause of the problem. I think the patch in c#3 fixes the problem, your use-case isn't crashing anymore. I'm marking the bug as Fixed. |
|||
►
Sign in to add a comment |
|||
Comment 1 by s...@chromium.org
, Aug 16 2017