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

Unified Diff: client/bin/site_crash_test.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/site_tests/logging_CrashSender/logging_CrashSender.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/bin/site_crash_test.py
diff --git a/client/bin/site_crash_test.py b/client/bin/site_crash_test.py
index f3887c3718d5e54691256aa9a0c7be55b3118473..df6ae3662831330d750d0ca961617a303ec7a440 100644
--- a/client/bin/site_crash_test.py
+++ b/client/bin/site_crash_test.py
@@ -186,6 +186,27 @@ class CrashTest(test.test):
'output': output}
+ def wait_for_sender_completion(self):
+ """Wait for crash_sender to complete.
+
+ Wait for no crash_sender's last message to be placed in the
+ system log before continuing and for the process to finish.
+ Otherwise we might get only part of the output."""
+ site_utils.poll_for_condition(
+ lambda: self._log_reader.can_find('crash_sender done.'),
+ timeout=60,
+ exception=error.TestError(
+ 'Timeout waiting for crash_sender to emit done: ' +
+ self._log_reader.get_logs()))
+ site_utils.poll_for_condition(
+ lambda: utils.system('pgrep crash_sender',
+ ignore_status=True) != 0,
+ timeout=60,
+ exception=error.TestError(
+ 'Timeout waiting for crash_sender to finish: ' +
+ self._log_reader.get_logs()))
+
+
def _call_sender_one_crash(self,
send_success=True,
reports_enabled=True,
@@ -215,16 +236,7 @@ class CrashTest(test.test):
script_output = utils.system_output(
'/bin/sh -c "%s" 2>&1' % self._CRASH_SENDER_PATH,
ignore_status=True)
- # Wait for up to 2s for no crash_sender to be running,
- # otherwise me might get only part of the output.
- site_utils.poll_for_condition(
- lambda: utils.system('pgrep crash_sender',
- ignore_status=True) != 0,
- timeout=2,
- exception=error.TestError(
- 'Timeout waiting for crash_sender to finish: ' +
- self._log_reader.get_logs()))
-
+ self.wait_for_sender_completion()
output = self._log_reader.get_logs()
logging.debug('Crash sender message output:\n' + output)
if script_output != '':
« no previous file with comments | « no previous file | client/site_tests/logging_CrashSender/logging_CrashSender.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698