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
1diff --git a/bin/cpufreq_test.py b/bin/cpufreq_test.py
2index 9901ccd..73fa651 100755
3--- a/bin/cpufreq_test.py
4+++ b/bin/cpufreq_test.py
5@@ -390,24 +390,29 @@ class CpuFreqTest:
6 # prove that we are single-threaded again
7 logging.info('* active threads: %i\n', threading.active_count())
8
9- # display results
10- logging.warning('[CpuFreqTest Results]') # for --quiet mode
11+ # process, then display results
12+ results = self._process_results()
13+ # provide time under test for debug/verbose output
14+ end_time = time.time() - start_time
15+
16+ print('[CpuFreqTest Results]')
17+ logging.debug('[Test Took: %.3fs]', end_time)
18 logging.info(
19 ' - legend:\n'
20 ' {core: {target_freq:'
21 '[sampled_med_%, P/F, sampled_median],:.\n')
22- # format result dict for human consumption
23- logging.info(
24- pprint.pformat(self._process_results()))
25- # provide time under test for debug/verbose output
26- end_time = time.time() - start_time
27- logging.debug('[Test Took: %.3fs]', end_time)
28+
29 if self.fail_count:
30+ print(
31+ pprint.pformat(results))
32 print('\n[Test Failed]\n'
33 '* core fail_count =', self.fail_count)
34 return 1
35
36+ logging.info(
37+ pprint.pformat(results))
38 print('\n[Test Passed]')
39+
40 return 0
41
42 def spawn_core_test(self):
43@@ -762,6 +767,7 @@ def main():
44 if user_arg.reset:
45 print('[Reset CpuFreq Sysfs]')
46 return cpu_freq_test.reset()
47+
48 return cpu_freq_test.execute_test()
49
50

Subscribers

People subscribed via source and target branches