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

Side by Side Diff: client/site_tests/logging_CrashSender/logging_CrashSender.py

Issue 3917003: autotest: Fix 2 more logging_CrashSender races and re-enable in smoke (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 2 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 | « client/bin/site_crash_test.py ('k') | client/site_tests/suite_Smoke/control » ('j') | 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) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS 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 import logging, os, re 5 import logging, os, re
6 from autotest_lib.client.bin import site_crash_test, site_utils, test 6 from autotest_lib.client.bin import site_crash_test, site_utils, test
7 from autotest_lib.client.common_lib import error, utils 7 from autotest_lib.client.common_lib import error, utils
8 8
9 _25_HOURS_AGO = -25 * 60 * 60 9 _25_HOURS_AGO = -25 * 60 * 60
10 _CRASH_SENDER_CRON_PATH = '/etc/cron.hourly/crash_sender.hourly' 10 _CRASH_SENDER_CRON_PATH = '/etc/cron.hourly/crash_sender.hourly'
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 Assuming we've run test_sender_simple which shows that a minidump 220 Assuming we've run test_sender_simple which shows that a minidump
221 gets removed as part of sending, we run the cron job (which is 221 gets removed as part of sending, we run the cron job (which is
222 asynchronous) and wait for that file to be removed to just verify 222 asynchronous) and wait for that file to be removed to just verify
223 the job eventually runs the sender.""" 223 the job eventually runs the sender."""
224 minidump = self._prepare_sender_one_crash(send_success=True, 224 minidump = self._prepare_sender_one_crash(send_success=True,
225 reports_enabled=True, 225 reports_enabled=True,
226 username='root', 226 username='root',
227 report=None) 227 report=None)
228 if not os.path.exists(minidump): 228 if not os.path.exists(minidump):
229 raise error.TestError('minidump not created') 229 raise error.TestError('minidump not created')
230 self._log_reader.set_start_by_current()
230 utils.system(_CRASH_SENDER_CRON_PATH) 231 utils.system(_CRASH_SENDER_CRON_PATH)
231 self._log_reader.set_start_by_current() 232 self.wait_for_sender_completion()
232 site_utils.poll_for_condition( 233 if os.path.exists(minidump):
233 lambda: not os.path.exists(minidump), 234 raise error.TestFail('minidump was not removed')
234 desc='minidump to be removed')
235 crash_sender_log = self._log_reader.get_logs() 235 crash_sender_log = self._log_reader.get_logs()
236 logging.debug('Contents of crash sender log: ' + crash_sender_log) 236 logging.debug('Contents of crash sender log: ' + crash_sender_log)
237 result = self._parse_sender_output(crash_sender_log) 237 result = self._parse_sender_output(crash_sender_log)
238 logging.debug('Result of crash send: %s' % result)
238 if not result['send_attempt'] or not result['send_success']: 239 if not result['send_attempt'] or not result['send_success']:
239 raise error.TestFail('Cron simple run test failed') 240 raise error.TestFail('Cron simple run test failed')
240 241
241 242
242 def run_once(self): 243 def run_once(self):
243 self.run_crash_tests([ 244 self.run_crash_tests([
244 'sender_simple_minidump', 245 'sender_simple_minidump',
245 'sender_simple_old_minidump', 246 'sender_simple_old_minidump',
246 'sender_simple_kernel_crash', 247 'sender_simple_kernel_crash',
247 'sender_pausing', 248 'sender_pausing',
248 'sender_reports_disabled', 249 'sender_reports_disabled',
249 'sender_rate_limiting', 250 'sender_rate_limiting',
250 'sender_single_instance', 251 'sender_single_instance',
251 'sender_send_fails', 252 'sender_send_fails',
252 'sender_orphaned_files', 253 'sender_orphaned_files',
253 'sender_incomplete_metadata', 254 'sender_incomplete_metadata',
254 'cron_runs']) 255 'cron_runs'])
OLDNEW
« no previous file with comments | « client/bin/site_crash_test.py ('k') | client/site_tests/suite_Smoke/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698