Hide "OOM Score" if not available

This commit is contained in:
Carsten Grohmann 2021-10-25 22:06:17 +02:00
parent f95899d7d5
commit aa28e0bb7c
3 changed files with 19 additions and 2 deletions

View File

@ -62,6 +62,10 @@
max-height: 200px;
}
.js-killed-proc-score--show {
/* empty - used to hide/show OOM score of killed process */
}
.js-oom-automatic--show {
/* empty - used to show sections for automatically triggered OOMs */
}
@ -325,7 +329,10 @@ window.onerror = function (msg, url, lineNo, columnNo, error) {
</div>
<p>
The process &quot;<span class="killed_proc_name"></span>&quot;
(PID <span class="killed_proc_pid"></span>) with an OOM score of <span class="killed_proc_score"></span>
(PID <span class="killed_proc_pid"></span>)
<span class="js-text--default-show js-killed-proc-score--show">
with an OOM score of <span class="killed_proc_score"></span>
</span>
has been terminated. It uses <span class="killed_proc_rss_percent"></span>
(<span class="killed_proc_total_rss_kb"></span>) of the resident memory.
</p>
@ -413,7 +420,7 @@ window.onerror = function (msg, url, lineNo, columnNo, error) {
</td>
<td>Process killed by Linux kernel to satisfy the memory request.</td>
</tr>
<tr>
<tr class="js-text--default-show js-killed-proc-score--show">
<td>OOM Score<br>(score)</td>
<td class="killed_proc_score text--align-right"></td>
<td>Programs with the highest OOM score are terminated first.</td>

View File

@ -1772,6 +1772,13 @@ Out of memory: Killed process 651 (unattended-upgr) total-vm:108020kB, anon-rss:
continue
self._set_item(item)
# Hide "OOM Score" if not available
# since KernelConfig_5_0.EXTRACT_PATTERN_OVERLAY_50['Process killed by OOM']
if 'killed_proc_score' in self.oom_result.details:
show_elements('.js-killed-proc-score--show')
else:
hide_elements('.js-killed-proc-score--show')
# generate process table
self.update_process_table()

View File

@ -213,6 +213,9 @@ class TestInBrowser(TestBase):
self.assertTrue('OOM killer was manually triggered' in explanation.text,
'Missing text "OOM killer was manually triggered"')
self.assertFalse('with an OOM score of' in explanation.text,
'No OOM score but text "with an OOM score of"')
self.check_swap_inactive()
def check_swap_inactive(self):