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

Side by Side Diff: chrome/test/functional/perf_endure.py

Issue 10540131: Chrome Endure tests no longer unnecessarily check for Deep Memory Profiler platform support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Performance tests for Chrome Endure (long-running perf tests on Chrome). 6 """Performance tests for Chrome Endure (long-running perf tests on Chrome).
7 7
8 This module accepts the following environment variable inputs: 8 This module accepts the following environment variable inputs:
9 TEST_LENGTH: The number of seconds in which to run each test. 9 TEST_LENGTH: The number of seconds in which to run each test.
10 PERF_STATS_INTERVAL: The number of seconds to wait in-between each sampling 10 PERF_STATS_INTERVAL: The number of seconds to wait in-between each sampling
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 def setUp(self): 62 def setUp(self):
63 # The environment variables for the Deep Memory Profiler must be set 63 # The environment variables for the Deep Memory Profiler must be set
64 # before perf.BasePerfTest.setUp() to inherit them to Chrome. 64 # before perf.BasePerfTest.setUp() to inherit them to Chrome.
65 self._deep_memory_profile = self._GetDeepMemoryProfileEnv( 65 self._deep_memory_profile = self._GetDeepMemoryProfileEnv(
66 'DEEP_MEMORY_PROFILE', bool, self._DEEP_MEMORY_PROFILE) 66 'DEEP_MEMORY_PROFILE', bool, self._DEEP_MEMORY_PROFILE)
67 67
68 self._deep_memory_profile_interval = self._GetDeepMemoryProfileEnv( 68 self._deep_memory_profile_interval = self._GetDeepMemoryProfileEnv(
69 'DEEP_MEMORY_PROFILE_INTERVAL', int, self._DEEP_MEMORY_PROFILE_INTERVAL) 69 'DEEP_MEMORY_PROFILE_INTERVAL', int, self._DEEP_MEMORY_PROFILE_INTERVAL)
70 70
71 if self._deep_memory_profile: 71 if self._deep_memory_profile:
72 if not self.IsLinux():
73 raise NotSupportedEnvironmentError(
74 'Deep Memory Profiler is not supported in this environment (OS).')
72 dir_prefix = 'endure.%s.' % datetime.today().strftime('%Y%m%d.%H%M%S') 75 dir_prefix = 'endure.%s.' % datetime.today().strftime('%Y%m%d.%H%M%S')
73 self._deep_tempdir = tempfile.mkdtemp(prefix=dir_prefix) 76 self._deep_tempdir = tempfile.mkdtemp(prefix=dir_prefix)
74 os.environ['HEAPPROFILE'] = os.path.join(self._deep_tempdir, 'endure') 77 os.environ['HEAPPROFILE'] = os.path.join(self._deep_tempdir, 'endure')
75 os.environ['HEAP_PROFILE_MMAP'] = 'True' 78 os.environ['HEAP_PROFILE_MMAP'] = 'True'
76 os.environ['DEEP_HEAP_PROFILE'] = 'True' 79 os.environ['DEEP_HEAP_PROFILE'] = 'True'
77 # TODO(dmikurube): Stop to set HEAP_PROFILE_TIME_INTERVAL when PyAuto 80 # TODO(dmikurube): Stop to set HEAP_PROFILE_TIME_INTERVAL when PyAuto
78 # supports to dump renderer heap profile. 81 # supports to dump renderer heap profile.
79 os.environ['HEAP_PROFILE_TIME_INTERVAL'] = ( 82 os.environ['HEAP_PROFILE_TIME_INTERVAL'] = (
80 str(self._deep_memory_profile_interval)) 83 str(self._deep_memory_profile_interval))
81 84
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 def _GetDeepMemoryProfileEnv(self, env_name, converter, default): 141 def _GetDeepMemoryProfileEnv(self, env_name, converter, default):
139 """Returns a converted environment variable for the Deep Memory Profiler. 142 """Returns a converted environment variable for the Deep Memory Profiler.
140 143
141 Args: 144 Args:
142 env_name: A string name of an environment variable. 145 env_name: A string name of an environment variable.
143 converter: A function taking a string to convert an environment variable. 146 converter: A function taking a string to convert an environment variable.
144 default: A value used if the environment variable is not specified. 147 default: A value used if the environment variable is not specified.
145 148
146 Returns: 149 Returns:
147 A value converted from the environment variable with 'converter'. 150 A value converted from the environment variable with 'converter'.
148
149 Raises:
150 NotSupportedEnvironmentError if the environment (OS) is not supported.
151 """ 151 """
152 if not self.IsLinux():
153 raise NotSupportedEnvironmentError(
154 'Deep Memory Profiler is not supported in this environment (OS).')
155 return converter(os.environ.get(env_name, default)) 152 return converter(os.environ.get(env_name, default))
156 153
157 def _WaitForDeepMemoryProfiler(self): 154 def _WaitForDeepMemoryProfiler(self):
158 """Waits for the Deep Memory Profiler to finish if running.""" 155 """Waits for the Deep Memory Profiler to finish if running."""
159 if self._deep_memory_profile and self._deep_memory_profile_proc: 156 if self._deep_memory_profile and self._deep_memory_profile_proc:
160 self._deep_memory_profile_proc.wait() 157 self._deep_memory_profile_proc.wait()
161 self._deep_memory_profile_proc = None 158 self._deep_memory_profile_proc = None
162 if self._deep_memory_profile_json_file: 159 if self._deep_memory_profile_json_file:
163 self._deep_memory_profile_last_json_filename = ( 160 self._deep_memory_profile_last_json_filename = (
164 self._deep_memory_profile_json_file.name) 161 self._deep_memory_profile_json_file.name)
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 self._driver, self._wait, 'id("state")[text()="offline"]'): 1067 self._driver, self._wait, 'id("state")[text()="offline"]'):
1071 self._num_errors += 1 1068 self._num_errors += 1
1072 time.sleep(1) 1069 time.sleep(1)
1073 1070
1074 self._RunEndureTest(self._webapp_name, self._tab_title_substring, 1071 self._RunEndureTest(self._webapp_name, self._tab_title_substring,
1075 test_description, scenario) 1072 test_description, scenario)
1076 1073
1077 1074
1078 if __name__ == '__main__': 1075 if __name__ == '__main__':
1079 pyauto_functional.Main() 1076 pyauto_functional.Main()
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