Closed Bug 1347177 Opened 7 years ago Closed 7 years ago

Custom mach command should cause job to fail when it fails

Categories

(Firefox Build System :: Task Configuration, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla55

People

(Reporter: wlach, Assigned: wlach)

References

Details

Attachments

(1 file)

Noticed when trying to custom retrigger for bug 1318389 that we're not actually failing the job when the custom test fails:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=6f2ad538f1c9939d57591e6f06a7a6e7750bd118&selectedJob=83496495

We really should. I think I just need to modify the bash script a bit we use to run mochitests.
Comment on attachment 8847242 [details]
Bug 1347177 - When doing custom retrigger, job should fail when custom mach command fails

Hey Dustin, I know this isn't necessarily your area but the usual person I'd ask to review this (:ahal) seems to be away, and this seems to be a trivial change to me.
It seems like in some cases mach returns an exit code of 1 even if there was a failure (in this case a leak):

https://treeherder.mozilla.org/#/jobs?repo=try&revision=f9f1ae807d384f42912547621443e46db90b00f7&selectedJob=83758884

I'll file another bug to look into that.
Comment on attachment 8847242 [details]
Bug 1347177 - When doing custom retrigger, job should fail when custom mach command fails

https://reviewboard.mozilla.org/r/120246/#review122162

::: taskcluster/scripts/tester/test-ubuntu.sh:193
(Diff revision 1)
>  fi
>  
>  # Run a custom mach command (this is typically used by action tasks to run
>  # harnesses in a particular way)
>  if [ "$CUSTOM_MACH_COMMAND" ]; then
>      eval "/home/worker/workspace/build/tests/mach ${CUSTOM_MACH_COMMAND}"

Do you think this was supposed to be "exec"?  That would have roughly the same effect..
Attachment #8847242 - Flags: review?(dustin) → review+
Comment on attachment 8847242 [details]
Bug 1347177 - When doing custom retrigger, job should fail when custom mach command fails

https://reviewboard.mozilla.org/r/120246/#review122162

> Do you think this was supposed to be "exec"?  That would have roughly the same effect..

Would the cleanup part of this script still get called if we called exec?
Comment on attachment 8847242 [details]
Bug 1347177 - When doing custom retrigger, job should fail when custom mach command fails

https://reviewboard.mozilla.org/r/120246/#review122642

::: taskcluster/scripts/tester/test-ubuntu.sh:193
(Diff revision 1)
>  fi
>  
>  # Run a custom mach command (this is typically used by action tasks to run
>  # harnesses in a particular way)
>  if [ "$CUSTOM_MACH_COMMAND" ]; then
>      eval "/home/worker/workspace/build/tests/mach ${CUSTOM_MACH_COMMAND}"

So the simple answer to this question is "no", the cleanup part would not be called. There are hacks around this, but using eval and returning $? is the right thing here, I think. I'm going to go ahead and land this as-is.

http://stackoverflow.com/questions/24111981/how-can-i-achieve-bash-exit-trap-when-exec-ing-another-binary#24112832
Pushed by wlachance@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e500058bdd0
When doing custom retrigger, job should fail when custom mach command fails r=dustin
Huh, I could swear I replied to comment 6 to say "oh, good point, go ahead and land" sorry!
https://hg.mozilla.org/mozilla-central/rev/8e500058bdd0
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: TaskCluster → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: