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

Side by Side Diff: run_isolated.py

Issue 18645002: Print to stdout when spending a long time downloading files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/swarm_client
Patch Set: Created 7 years, 5 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 """Reads a .isolated, creates a tree of hardlinks and runs the test. 6 """Reads a .isolated, creates a tree of hardlinks and runs the test.
7 7
8 Keeps a local cache. 8 Keeps a local cache.
9 """ 9 """
10 10
(...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 else: 1769 else:
1770 shutil.copyfile(no_cache.path(obj), outfile) 1770 shutil.copyfile(no_cache.path(obj), outfile)
1771 1771
1772 if 'm' in properties and not sys.platform == 'win32': 1772 if 'm' in properties and not sys.platform == 'win32':
1773 # It's not set on Windows. It could be set only in the case of 1773 # It's not set on Windows. It could be set only in the case of
1774 # downloading content generated from another OS. Do not crash in that 1774 # downloading content generated from another OS. Do not crash in that
1775 # case. 1775 # case.
1776 os.chmod(outfile, properties['m']) 1776 os.chmod(outfile, properties['m'])
1777 1777
1778 if time.time() - last_update > DELAY_BETWEEN_UPDATES_IN_SECS: 1778 if time.time() - last_update > DELAY_BETWEEN_UPDATES_IN_SECS:
1779 logging.info('%d files remaining...' % len(remaining)) 1779 logging.info('%d files remaining...' % len(remaining))
Vadim Sh. 2013/07/03 15:29:50 And maybe convert this to 'print' as well, for con
csharp 2013/07/03 17:27:10 Done.
1780 last_update = time.time() 1780 last_update = time.time()
1781 1781
1782 print('.isolated files successfully downloaded and setup in %s' % 1782 print('.isolated files successfully downloaded and setup in %s' %
1783 target_directory) 1783 target_directory)
1784 print('To run this test please run the command %s from the directory %s' % 1784 print('To run this test please run the command %s from the directory %s' %
1785 (cmd, cwd)) 1785 (cmd, cwd))
1786 1786
1787 return 0 1787 return 0
1788 1788
1789 1789
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 while remaining: 1825 while remaining:
1826 obj = cache.wait_for(remaining) 1826 obj = cache.wait_for(remaining)
1827 for filepath, properties in remaining.pop(obj): 1827 for filepath, properties in remaining.pop(obj):
1828 outfile = os.path.join(outdir, filepath) 1828 outfile = os.path.join(outdir, filepath)
1829 link_file(outfile, cache.path(obj), HARDLINK) 1829 link_file(outfile, cache.path(obj), HARDLINK)
1830 if 'm' in properties: 1830 if 'm' in properties:
1831 # It's not set on Windows. 1831 # It's not set on Windows.
1832 os.chmod(outfile, properties['m']) 1832 os.chmod(outfile, properties['m'])
1833 1833
1834 if time.time() - last_update > DELAY_BETWEEN_UPDATES_IN_SECS: 1834 if time.time() - last_update > DELAY_BETWEEN_UPDATES_IN_SECS:
1835 logging.info('%d files remaining...' % len(remaining)) 1835 print('%d files remaining...' % len(remaining))
1836 last_update = time.time() 1836 last_update = time.time()
1837 1837
1838 if settings.read_only: 1838 if settings.read_only:
1839 make_writable(outdir, True) 1839 make_writable(outdir, True)
1840 logging.info('Running %s, cwd=%s' % (cmd, cwd)) 1840 logging.info('Running %s, cwd=%s' % (cmd, cwd))
1841 1841
1842 # TODO(csharp): This should be specified somewhere else. 1842 # TODO(csharp): This should be specified somewhere else.
1843 # Add a rotating log file if one doesn't already exist. 1843 # Add a rotating log file if one doesn't already exist.
1844 env = os.environ.copy() 1844 env = os.environ.copy()
1845 env.setdefault('RUN_TEST_CASES_LOG_FILE', RUN_TEST_CASES_LOG) 1845 env.setdefault('RUN_TEST_CASES_LOG_FILE', RUN_TEST_CASES_LOG)
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 except Exception, e: 1954 except Exception, e:
1955 # Make sure any exception is logged. 1955 # Make sure any exception is logged.
1956 logging.exception(e) 1956 logging.exception(e)
1957 return 1 1957 return 1
1958 1958
1959 1959
1960 if __name__ == '__main__': 1960 if __name__ == '__main__':
1961 # Ensure that we are always running with the correct encoding. 1961 # Ensure that we are always running with the correct encoding.
1962 fix_default_encoding() 1962 fix_default_encoding()
1963 sys.exit(main()) 1963 sys.exit(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