Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1415)

Side by Side Diff: base/test/test_timeouts.cc

Issue 14352009: Double the timeout values when running under ThreadSanitizer v2. It is at least as slow as AddressS… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/test/test_timeouts.h" 5 #include "base/test/test_timeouts.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/test/test_switches.h" 10 #include "base/test/test_switches.h"
11 11
12 namespace { 12 namespace {
13 13
14 #ifdef ADDRESS_SANITIZER 14 // ASan and TSan instrument each memory access. This may slow the execution
15 // down significantly.
16 #if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER)
15 static const int kTimeoutMultiplier = 2; 17 static const int kTimeoutMultiplier = 2;
16 #else 18 #else
17 static const int kTimeoutMultiplier = 1; 19 static const int kTimeoutMultiplier = 1;
18 #endif 20 #endif
19 21
20 // Sets value to the greatest of: 22 // Sets value to the greatest of:
21 // 1) value's current value multiplied by kTimeoutMultiplier (assuming 23 // 1) value's current value multiplied by kTimeoutMultiplier (assuming
22 // InitializeTimeout is called only once per value). 24 // InitializeTimeout is called only once per value).
23 // 2) min_value. 25 // 2) min_value.
24 // 3) the numerical value given by switch_name on the command line multiplied 26 // 3) the numerical value given by switch_name on the command line multiplied
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 InitializeTimeout(switches::kUiTestActionMaxTimeout, action_timeout_ms_, 79 InitializeTimeout(switches::kUiTestActionMaxTimeout, action_timeout_ms_,
78 &action_max_timeout_ms_); 80 &action_max_timeout_ms_);
79 InitializeTimeout(switches::kTestLargeTimeout, action_max_timeout_ms_, 81 InitializeTimeout(switches::kTestLargeTimeout, action_max_timeout_ms_,
80 &large_test_timeout_ms_); 82 &large_test_timeout_ms_);
81 83
82 // The timeout values should be increasing in the right order. 84 // The timeout values should be increasing in the right order.
83 CHECK(tiny_timeout_ms_ <= action_timeout_ms_); 85 CHECK(tiny_timeout_ms_ <= action_timeout_ms_);
84 CHECK(action_timeout_ms_ <= action_max_timeout_ms_); 86 CHECK(action_timeout_ms_ <= action_max_timeout_ms_);
85 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_); 87 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_);
86 } 88 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698