Commit bc8f2928 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

[sync] Add traces to debug integration test execution time

These tests experience setup slowness on Mac leading to flakiness, so
let's add a few traces to confirm this hypothesis and narrow down the
source of the slowness.

Bug: 1131588
Change-Id: Idc077fab344c17d64a98cdc4146dd049d37b02f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431026Reviewed-by: default avatarVictor Vianna <victorvianna@google.com>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810573}
parent 4a331501
...@@ -227,6 +227,7 @@ bool SyncTest::FakeInstanceIDDriver::ExistsInstanceID( ...@@ -227,6 +227,7 @@ bool SyncTest::FakeInstanceIDDriver::ExistsInstanceID(
SyncTest::SyncTest(TestType test_type) SyncTest::SyncTest(TestType test_type)
: test_type_(test_type), : test_type_(test_type),
test_construction_time_(base::Time::Now()),
server_type_(SERVER_TYPE_UNDECIDED), server_type_(SERVER_TYPE_UNDECIDED),
previous_profile_(nullptr), previous_profile_(nullptr),
num_clients_(-1), num_clients_(-1),
...@@ -279,6 +280,9 @@ void SyncTest::SetUp() { ...@@ -279,6 +280,9 @@ void SyncTest::SetUp() {
// Yield control back to the PlatformBrowserTest framework. // Yield control back to the PlatformBrowserTest framework.
PlatformBrowserTest::SetUp(); PlatformBrowserTest::SetUp();
LOG(INFO) << "SyncTest::SetUp() completed; elapsed time since construction: "
<< (base::Time::Now() - test_construction_time_);
} }
void SyncTest::TearDown() { void SyncTest::TearDown() {
...@@ -571,6 +575,10 @@ bool SyncTest::SetupClients() { ...@@ -571,6 +575,10 @@ bool SyncTest::SetupClients() {
if (!CreateProfile(i)) { if (!CreateProfile(i)) {
return false; return false;
} }
LOG(INFO) << "SyncTest::SetupClients() created profile " << i
<< "; elapsed time since construction: "
<< (base::Time::Now() - test_construction_time_);
} }
// Verifier account is not useful when running against external servers. // Verifier account is not useful when running against external servers.
...@@ -611,6 +619,10 @@ bool SyncTest::SetupClients() { ...@@ -611,6 +619,10 @@ bool SyncTest::SetupClients() {
} }
#endif #endif
LOG(INFO)
<< "SyncTest::SetupClients() completed; elapsed time since construction: "
<< (base::Time::Now() - test_construction_time_);
return true; return true;
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/buildflag.h" #include "build/buildflag.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -405,6 +406,13 @@ class SyncTest : public PlatformBrowserTest { ...@@ -405,6 +406,13 @@ class SyncTest : public PlatformBrowserTest {
void ClearProfiles(); void ClearProfiles();
// Used to differentiate between single-client and two-client tests.
const TestType test_type_;
// Used to remember when the test fixture was constructed and later understand
// how long the setup took.
const base::Time test_construction_time_;
// GAIA account used by the test case. // GAIA account used by the test case.
std::string username_; std::string username_;
...@@ -414,10 +422,6 @@ class SyncTest : public PlatformBrowserTest { ...@@ -414,10 +422,6 @@ class SyncTest : public PlatformBrowserTest {
// Locally available plain text file in which GAIA credentials are stored. // Locally available plain text file in which GAIA credentials are stored.
base::FilePath password_file_; base::FilePath password_file_;
// Used to differentiate between single-client and two-client tests as well
// as wher the in-process FakeServer is used.
TestType test_type_;
// Tells us what kind of server we're using (some tests run only on certain // Tells us what kind of server we're using (some tests run only on certain
// server types). // server types).
ServerType server_type_; ServerType server_type_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment