diff options
author | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-24 03:09:16 +0000 |
---|---|---|
committer | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-24 03:09:16 +0000 |
commit | 692600df9ab0ff7c75ac79803d18f4a98cda1794 (patch) | |
tree | 592fa5d30e3e229506ca95d76720422d0ae671e2 | |
parent | f30e71d6e2be936025c18c304995e4953671c9db (diff) | |
download | chromium_src-692600df9ab0ff7c75ac79803d18f4a98cda1794.zip chromium_src-692600df9ab0ff7c75ac79803d18f4a98cda1794.tar.gz chromium_src-692600df9ab0ff7c75ac79803d18f4a98cda1794.tar.bz2 |
[Telemetry] Fix potential flake in testPagesetRepeat.
A previous patch of mine (which seems unrelated) triggered flake in os.remove()
complaining that the file was still open. It seems like there could be a race
with closing the file here. The with-block should make it deterministic.
BUG=223572
Review URL: https://codereview.chromium.org/256413002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265825 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | tools/telemetry/telemetry/page/page_runner_unittest.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/telemetry/telemetry/page/page_runner_unittest.py b/tools/telemetry/telemetry/page/page_runner_unittest.py index 53740c4..1ae14f7 100644 --- a/tools/telemetry/telemetry/page/page_runner_unittest.py +++ b/tools/telemetry/telemetry/page/page_runner_unittest.py @@ -230,7 +230,8 @@ class PageRunnerTests(unittest.TestCase): results.PrintSummary() self.assertEquals(4, len(results.successes)) self.assertEquals(0, len(results.failures)) - stdout = open(output_file).read() + with open(output_file) as f: + stdout = f.read() self.assertIn('RESULT metric_by_url: blank.html= [1,3] unit', stdout) self.assertIn('RESULT metric_by_url: green_rect.html= [2,4] unit', stdout) self.assertIn('*RESULT metric: metric= [1,2,3,4] unit', stdout) |