diff options
author | dennisjeffrey@chromium.org <dennisjeffrey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 23:10:03 +0000 |
---|---|---|
committer | dennisjeffrey@chromium.org <dennisjeffrey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 23:10:03 +0000 |
commit | aac510a6d64d91040cf589c701575ca09fa3d820 (patch) | |
tree | 0bb2fff7d843022a4d91b57911ffff3c1d7627ef | |
parent | 15e147bde27794e47f3c73f04db98c3649e45a64 (diff) | |
download | chromium_src-aac510a6d64d91040cf589c701575ca09fa3d820.zip chromium_src-aac510a6d64d91040cf589c701575ca09fa3d820.tar.gz chromium_src-aac510a6d64d91040cf589c701575ca09fa3d820.tar.bz2 |
Add argument use_poll=True to asyncore.loop() calls in perf_snapshot.py.
This change causes asyncore.loop() to internally use poll() instead of
select(), which may prevent the "bad file descriptor" exception from being
thrown on the Chrome Endure tests.
Also enhanced an assertion error message in perf_endure.py to give more
context if the assertion is violated.
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/9309019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119983 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/functional/perf_endure.py | 4 | ||||
-rwxr-xr-x | chrome/test/pyautolib/perf_snapshot.py | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/chrome/test/functional/perf_endure.py b/chrome/test/functional/perf_endure.py index 431dad6..1036477 100644 --- a/chrome/test/functional/perf_endure.py +++ b/chrome/test/functional/perf_endure.py @@ -73,7 +73,9 @@ class ChromeEndureBaseTest(perf.BasePerfTest): tab_proc_info.append(proc_info) self.assertEqual(len(tab_proc_info), 1, msg='Expected to find 1 %s tab process, but found %d ' - 'instead.' % (tab_title_substring, len(tab_proc_info))) + 'instead.\nCurrent process info:\n%s.' % ( + tab_title_substring, len(tab_proc_info), + self.pformat(info))) tab_proc_info = tab_proc_info[0] return { 'private_mem': tab_proc_info['working_set_mem']['priv'] diff --git a/chrome/test/pyautolib/perf_snapshot.py b/chrome/test/pyautolib/perf_snapshot.py index d5ea276..cddc0d0 100755 --- a/chrome/test/pyautolib/perf_snapshot.py +++ b/chrome/test/pyautolib/perf_snapshot.py @@ -442,7 +442,7 @@ class _RemoteInspectorBaseThread(threading.Thread): while asyncore.socket_map: if self._client.handshake_done or self._killed: break - asyncore.loop(timeout=1, count=1) + asyncore.loop(timeout=1, count=1, use_poll=True) def NotifySocketClientException(self): """Notifies that the _DevToolsSocketClient encountered an exception.""" @@ -959,7 +959,7 @@ class PerformanceSnapshotter(object): while asyncore.socket_map: if not snapshotter_thread.is_alive(): break - asyncore.loop(timeout=1, count=1) + asyncore.loop(timeout=1, count=1, use_poll=True) except KeyboardInterrupt: pass self._logger.debug('Waiting for snapshotter thread to die...') @@ -976,7 +976,7 @@ class PerformanceSnapshotter(object): while asyncore.socket_map: if not gc_thread.is_alive(): break - asyncore.loop(timeout=1, count=1) + asyncore.loop(timeout=1, count=1, use_poll=True) except KeyboardInterrupt: pass gc_thread.join() @@ -998,7 +998,7 @@ class PerformanceSnapshotter(object): while asyncore.socket_map: if not mem_count_thread.is_alive(): break - asyncore.loop(timeout=1, count=1) + asyncore.loop(timeout=1, count=1, use_poll=True) except KeyboardInterrupt: pass mem_count_thread.join() |