-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFE] Restraint should allow user to specify the action upon git fetch task failure #288
Comments
Hi Vector,
Thanks for looking into it!
The issue is that we have nowhere where to put this command. It's a
chicken egg problem. When git fetch fails, there is no code to be executed.
This has to be handled by the Restraint itself.
Jirka
…On Wed, Feb 22, 2023 at 4:57 AM Vector Li ***@***.***> wrote:
Hi @jirka-h <https://github.com/jirka-h>, please have a try to use
cki_abort_recipe
<https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/blob/main/cki_lib/libcki.sh#L88>
to abort a recipe.
# From: https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/blob/main/cki_lib/libcki.sh#L65
65 #
66 # When a serious problem occurs and we cannot proceed any further, we abort
67 # this recipe with an error message.
68 #
69 # Arguments:
70 # $1 - the message to print in the log
71 # $2 - 'WARN' or 'FAIL'
72 #
73 function cki_abort_recipe()
74 {
75 typeset failure_message="$1"
76 typeset failure_type=${2:-"FAIL"}
77
78 echo "❌ ${failure_message}"
79 if [[ "$failure_type" == 'WARN' ]]; then
80 rstrnt-report-result "${RSTRNT_TASKNAME}" WARN 99
81 else
82 rstrnt-report-result "${RSTRNT_TASKNAME}" FAIL 1
83 fi
84 rstrnt-abort -t recipe
85 exit $CKI_STATUS_ABORTED
86 }
Please be noted that *L84 and L85 are required when aborting a recipe*.
For details, please refer to the comments of mine in
kernel-tests/-/issues/1576
<https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/issues/1576>
.
—
Reply to this email directly, view it on GitHub
<#288 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2U5OKF7H2JXX32RVHA2C3WYWFC5ANCNFSM6AAAAAAVC4JHJY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The request here should be to abort the recipe in which the task fails, not the entire job (which might have other recipes which don't have the same problem; if they do, they can abort themselves). |
Hi Eirik, yes, you are right! We want to abort the recipe here. Thanks for pointing this out! Jirka |
+1 on adding this "kill-switch", even per recipe (if per task is too much to ask). Thanks in advance! |
BTW it also makes sense to increase the number of fetch-url retries, as well as longer delay (incrementally) before each retry. |
see: restraint-harness#288 and support customize the task fetch options in param: _fetch_opts: retry=N timeo=N keepchanges abort_recipe|abort_recipe_when_fetch_fail e.g: If the key task /kernel/install fetch fails, subsequent tasks will not run: <task name="/kernel/install"> <fetch url="http://a.b.c/path/archive.tgz#rpath"/> <params> <param name="_fetch_opts" value="retry=16,timeo=16,abort_recipe"/> <param name="KERNEL_VER" value="kernel-6.7.0-119.el10"/> </params> </task> <task name="/kernel/fs/nfs/test1"> <fetch url="http://a.b.c/path/archive.tgz#rpath1"/> <params> <param name="_fetch_opts" value="retry=8,keepchanges"/> <param name="KERNEL_VER" value="kernel-6.7.0-119.el10"/> </params> </task> Q: why add these options in task params? A: because beaker job xml schema has not accept the new xml tag, so as a workaround I put these fetch options in task->params Signed-off-by: Jianhong Yin <[email protected]>
Hello,
we have migrated the Linux Kernel Install task to the "git fetch" flow. When testing, we have run into this problem:
In such a situation, we need the Beaker job to be aborted immediately. We are looking for a way to specify for the git fetch task an action when it fails to download the test.
Thanks a lot
Jirka
The text was updated successfully, but these errors were encountered: