Merge ~alanec/plainbox-provider-checkbox:cpufreq_test-failure-output into plainbox-provider-checkbox:master

Proposed by Adrian Lane
Status: Merged
Approved by: Jeff Lane 
Approved revision: 9fa92cce7d6b6d00a6c188859589d4ccd6b73079
Merged at revision: 25fbafa5254782a8cfb1db8dc01629d38312bc27
Proposed branch: ~alanec/plainbox-provider-checkbox:cpufreq_test-failure-output
Merge into: plainbox-provider-checkbox:master
Diff against target: 48 lines (+14/-8)
1 file modified
bin/cpufreq_test.py (+14/-8)
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+399106@code.launchpad.net

Description of the change

Simple update to ensure that when this test fails, we output the results of the test, even in quiet mode.
This is to address some of the bare bone failures we're seeing, as currently we're having the test manually re-run without output turned on to get more information.

This has a higher priority than the other MR in progress (support mode / support check).

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

I'm not entirely sure what --verbose does, actually? looking at a diff of the output of -v and -d run back to back on the same machine, there doesn't appear to be any substantive difference.

In fact once I remove the unimportant differing lines (just the ones where on the first run a timestamp, pid, or other number was different) the only difference between the two is this:

  1 3a4,5
  2 > * disabling thread siblings (hyperthreading):
  3 > - disabling cores: {4, 5, 6, 7}

those two lines are present in the debug but not in verbose.

Also, for normal output (e.g. not -v or -d) I think all we need is this:

[CpuFreqTest Results]
 - legend:
   {core: {target_freq:[sampled_med_%, P/F, sampled_median],:.

{0: {800000: ['100%', 'Pass', 800000]},
 1: {800000: ['100%', 'Pass', 800000]},
 2: {800000: ['100%', 'Pass', 800000]},
 3: {800000: ['100%', 'Pass', 800000]}}

[Test Passed]

and THIS should be the output for -v

$ sudo ./cpufreq_test.py
---------------------
| CpuFreqTest Begin |
---------------------
* disabling thread siblings (hyperthreading):
  - disabling cores: {4, 5, 6, 7}
* configuring cpu governors:
  - setting governor: performance
---------------------
* testing: cpu1 || target freq: 800000 || work: fact(39340) || worker pid: 25775
* testing: cpu2 || target freq: 800000 || work: fact(39002) || worker pid: 25776
* testing: cpu3 || target freq: 800000 || work: fact(37725) || worker pid: 25777
* testing: cpu0 || target freq: 800000 || work: fact(38232) || worker pid: 25778
* testing: cpu3 || target freq: 800000 || work: fact(38298) || worker pid: 25777
* testing: cpu1 || target freq: 800000 || work: fact(39484) || worker pid: 25775
* testing: cpu0 || target freq: 800000 || work: fact(38701) || worker pid: 25778
* testing: cpu2 || target freq: 800000 || work: fact(39627) || worker pid: 25776
----------------------------
* joining and closing queues
* joining worker processes:
  - PID 25775 joined parent
  - PID 25776 joined parent
  - PID 25777 joined parent
  - PID 25778 joined parent

-----------------
| Test Complete |
-----------------

[Reset & Cleanup]
* restoring startup governor:
  - setting governor: performance
* enabling thread siblings/hyperthreading:
  - enabling cores: {4, 5, 6, 7}
* restoring max, min freq files
* terminating dangling pids
* active threads: 1

[CpuFreqTest Results]
 - legend:
   {core: {target_freq:[sampled_med_%, P/F, sampled_median],:.

{0: {800000: ['100%', 'Pass', 800000]},
 1: {800000: ['100%', 'Pass', 800000]},
 2: {800000: ['100%', 'Pass', 800000]},
 3: {800000: ['100%', 'Pass', 800000]}}

[Test Passed]

And then -d should stay as it is.

review: Needs Fixing
Revision history for this message
Adrian Lane (alanec) wrote :

For some reason I thought we wanted both debug and verbose options that both did the same thing. I must be misremembering the conversation or it never actually happened.
I'm totally fine with just debug mode, I'll remove the verbose mode fllags and resubmit shortly.

Revision history for this message
Adrian Lane (alanec) wrote :

Looking back at this MR, I was interrupted before I could finish reading your prior comments originally, thus I assumed to pull verbose mode. Sorry about that.
Even though I've discarded the addition of verbose mode, I can go back and add it as you were saying. I think this idea has merit, we can touch base tomorrow in regards to moving forward with this proposal or adding verbose mode as previous described.

Revision history for this message
Jeff Lane  (bladernr) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/cpufreq_test.py b/bin/cpufreq_test.py
index 9901ccd..73fa651 100755
--- a/bin/cpufreq_test.py
+++ b/bin/cpufreq_test.py
@@ -390,24 +390,29 @@ class CpuFreqTest:
390 # prove that we are single-threaded again390 # prove that we are single-threaded again
391 logging.info('* active threads: %i\n', threading.active_count())391 logging.info('* active threads: %i\n', threading.active_count())
392392
393 # display results393 # process, then display results
394 logging.warning('[CpuFreqTest Results]') # for --quiet mode394 results = self._process_results()
395 # provide time under test for debug/verbose output
396 end_time = time.time() - start_time
397
398 print('[CpuFreqTest Results]')
399 logging.debug('[Test Took: %.3fs]', end_time)
395 logging.info(400 logging.info(
396 ' - legend:\n'401 ' - legend:\n'
397 ' {core: {target_freq:'402 ' {core: {target_freq:'
398 '[sampled_med_%, P/F, sampled_median],:.\n')403 '[sampled_med_%, P/F, sampled_median],:.\n')
399 # format result dict for human consumption404
400 logging.info(
401 pprint.pformat(self._process_results()))
402 # provide time under test for debug/verbose output
403 end_time = time.time() - start_time
404 logging.debug('[Test Took: %.3fs]', end_time)
405 if self.fail_count:405 if self.fail_count:
406 print(
407 pprint.pformat(results))
406 print('\n[Test Failed]\n'408 print('\n[Test Failed]\n'
407 '* core fail_count =', self.fail_count)409 '* core fail_count =', self.fail_count)
408 return 1410 return 1
409411
412 logging.info(
413 pprint.pformat(results))
410 print('\n[Test Passed]')414 print('\n[Test Passed]')
415
411 return 0416 return 0
412417
413 def spawn_core_test(self):418 def spawn_core_test(self):
@@ -762,6 +767,7 @@ def main():
762 if user_arg.reset:767 if user_arg.reset:
763 print('[Reset CpuFreq Sysfs]')768 print('[Reset CpuFreq Sysfs]')
764 return cpu_freq_test.reset()769 return cpu_freq_test.reset()
770
765 return cpu_freq_test.execute_test()771 return cpu_freq_test.execute_test()
766772
767773

Subscribers

People subscribed via source and target branches