Merge ~bladernr/plainbox-provider-checkbox:add-syslog-calltrace-check into plainbox-provider-checkbox:master

Proposed by Jeff Lane 
Status: Merged
Approved by: Jeff Lane 
Approved revision: bfea0b533cd1e747fe48389b32409f2108e3f470
Merged at revision: 79b000aa33b350612927bfbeebcc84237f75d822
Proposed branch: ~bladernr/plainbox-provider-checkbox:add-syslog-calltrace-check
Merge into: plainbox-provider-checkbox:master
Diff against target: 26 lines (+18/-0)
1 file modified
jobs/miscellanea.txt.in (+18/-0)
Reviewer Review Type Date Requested Status
Maciej Kisielewski Approve
Jeff Lane  Needs Resubmitting
Review via email: mp+329229@code.launchpad.net

Description of the change

Add new job to miscellanea to check syslog for call traces. Intended to be the last job run after testing just as a marker to say "Hey, something caused an oops!"

To post a comment you must log in.
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

+0.99. manage.py will complain (or advice) to use `flags: preserve-locale`.
Landable, just consider adding that notorious flag ;).

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

Flag added, and added an attachment job too...

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

Can you doublecheck that the attachment job makes sense?

review: Needs Resubmitting
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

I don't like the idea of having two jobs doing the same thing, really.
If you insist on having two, I recommend adding 'depends: ' for the attachment one.

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

On Tue, Aug 22, 2017 at 1:13 PM, Maciej Kisielewski
<email address hidden> wrote:
> Review: Needs Fixing
>
> I don't like the idea of having two jobs doing the same thing, really.

In a perfect world, I would just have the one job, and the attachment
job would be much more simple, and only run if the parent job fails.
Unfortunately, checkbox doesn't have that ability.

> If you insist on having two, I recommend adding 'depends: ' for the attachment one.

If I add a depends, the attachment job will only run when the check
job passes. And the check job passes when there are no Call Trace
dumps present. So that would have the opposite effect of what is
desired here (that the syslog be attached when the Call Trace check
fails.

Unfortunately, I can't use just the attachment job, because it will
never output into the results summary (e.g. there will never be a line
item in the test results that says "attach-syslog: FAIL: Call Trace
dumps detected, syslog has been attached."

I also don't want it to attach syslog needlessly on every submission.
This was a compromise.

Likewise, I can't change call-trace-check to PASS if call traces are
detected, because call traces in syslog are a fail condition, not a
success condition. That just creates a false positive (or is that a
positive negative?).

And I don't want to just cat syslog in call-trace-check itself,
polluting the results table with potentially hundreds or thousands of
lines of text that are better off as a physical attachment.

That said, this bug would address the issue nicely:
https://bugs.launchpad.net/checkbox-ng/+bug/1712352

> --
> https://code.launchpad.net/~bladernr/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+merge/329229
> You are the owner of ~bladernr/plainbox-provider-checkbox:add-syslog-calltrace-check.
>
> Launchpad-Message-Rationale: Owner
> Launchpad-Message-For: bladernr
> Launchpad-Notification-Type: code-review
> Launchpad-Branch: ~bladernr/plainbox-provider-checkbox/+git/plainbox-provider-checkbox:add-syslog-calltrace-check
> Launchpad-Project: plainbox-provider-checkbox

--
"Entropy isn't what it used to be."

Jeff Lane -
Server Certification Lead, Warrior Poet, Biker, Lover of Pie
Phone: 919-442-8649
Ubuntu Ham: W4KDH Freenode IRC: bladernr or bladernr_
gpg: 1024D/3A14B2DD 8C88 B076 0DD7 B404 1417 C466 4ABD 3635 3A14 B2DD

Revision history for this message
Maciej Kisielewski (kissiel) wrote :

> On Tue, Aug 22, 2017 at 1:13 PM, Maciej Kisielewski
> <email address hidden> wrote:
> > Review: Needs Fixing
> >
> > I don't like the idea of having two jobs doing the same thing, really.
>
> In a perfect world, I would just have the one job, and the attachment
> job would be much more simple, and only run if the parent job fails.
> Unfortunately, checkbox doesn't have that ability.
>
> > If you insist on having two, I recommend adding 'depends: ' for the
> attachment one.
>
> If I add a depends, the attachment job will only run when the check
> job passes. And the check job passes when there are no Call Trace
> dumps present. So that would have the opposite effect of what is
> desired here (that the syslog be attached when the Call Trace check
> fails.
>
> Unfortunately, I can't use just the attachment job, because it will
> never output into the results summary (e.g. there will never be a line
> item in the test results that says "attach-syslog: FAIL: Call Trace
> dumps detected, syslog has been attached."
>
> I also don't want it to attach syslog needlessly on every submission.
> This was a compromise.
>
> Likewise, I can't change call-trace-check to PASS if call traces are
> detected, because call traces in syslog are a fail condition, not a
> success condition. That just creates a false positive (or is that a
> positive negative?).
>
> And I don't want to just cat syslog in call-trace-check itself,
> polluting the results table with potentially hundreds or thousands of
> lines of text that are better off as a physical attachment.
>
> That said, this bug would address the issue nicely:
> https://bugs.launchpad.net/checkbox-ng/+bug/1712352
>
>
>
>
> > --
> > https://code.launchpad.net/~bladernr/plainbox-provider-checkbox/+git
> /plainbox-provider-checkbox/+merge/329229
> > You are the owner of ~bladernr/plainbox-provider-checkbox:add-syslog-
> calltrace-check.
> >
> > Launchpad-Message-Rationale: Owner
> > Launchpad-Message-For: bladernr
> > Launchpad-Notification-Type: code-review
> > Launchpad-Branch: ~bladernr/plainbox-provider-checkbox/+git/plainbox-
> provider-checkbox:add-syslog-calltrace-check
> > Launchpad-Project: plainbox-provider-checkbox
>
>
>
> --
> "Entropy isn't what it used to be."
>
> Jeff Lane -
> Server Certification Lead, Warrior Poet, Biker, Lover of Pie
> Phone: 919-442-8649
> Ubuntu Ham: W4KDH Freenode IRC: bladernr or bladernr_
> gpg: 1024D/3A14B2DD 8C88 B076 0DD7 B404 1417 C466 4ABD 3635 3A14 B2DD

Woderful explanation, thank you.
I changed my mind. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/jobs/miscellanea.txt.in b/jobs/miscellanea.txt.in
2index 6dec07d..c9434c1 100644
3--- a/jobs/miscellanea.txt.in
4+++ b/jobs/miscellanea.txt.in
5@@ -354,3 +354,21 @@ user: root
6 command:
7 SOSFILE=`ls -t $PLAINBOX_SESSION_SHARE/sosreport*xz | head -1`; [ -e ${SOSFILE} ] && base64 $SOSFILE
8 _summary: Attach the baseline sosreport file
9+
10+plugin: shell
11+category_id: com.canonical.plainbox::miscellanea
12+estimated_duration: 0.5
13+id: miscellanea/call-trace-check
14+command: if [ -n "$(grep "Call Trace:" /var/log/syslog)" ]; then echo "Call Trace detected in syslog"; false; else true; fi
15+_summary: Check syslog for call traces
16+_description: Checks syslog for call traces after testing is complete.
17+flags: preserve-locale
18+
19+plugin: attachment
20+category_id: com.canonical.plainbox::miscellanea
21+estimated_duration: 0.5
22+id: miscellanea/attach-syslog
23+command: if [ -n "$(grep "Call Trace:" /var/log/syslog)" ]; then cat /var/log/syslog; fi
24+_summary: Attach syslog if Call Trace appears
25+_description: Attaches a copy of syslog if call traces are present after testing is complete.
26+flags: preserve-locale

Subscribers

People subscribed via source and target branches