Skip to content
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

Restraint returns exit code 1 on watchdog timeout #186

Open
thrix opened this issue Mar 1, 2021 · 1 comment
Open

Restraint returns exit code 1 on watchdog timeout #186

thrix opened this issue Mar 1, 2021 · 1 comment

Comments

@thrix
Copy link

thrix commented Mar 1, 2021

restraint version: restraint-client-0.2.0-2.fc31eng.x86_64

In our CI we see:

....
[10.0.207.168        ] 1614485462 [Setup                                      ] PASS Score: 0
[10.0.207.168        ] 1614485463 [Test                                       ] PASS Score: 0
[10.0.207.168        ] 1614485464 [Cleanup                                    ] PASS Score: 0
[10.0.207.168        ] T:      23 [obs-with-multiple-files-don-t-complete-when] Completed: PASS
[10.0.207.168        ] T:      24 [460-cups-stack-buffer-overflow-in-libcups-s] Running
[10.0.207.168        ] 1614485468 [/10_localwatchdog                          ] WARN Score: 0
[10.0.207.168        ] 1614485469 [/99_reboot                                 ] WARN Score: 0

---^---^---^---^---^---
[05:17:29] [E] [J#0 RS#0] test execution failed: restraint command exited with return code 1: Recipe 1 exceeded lab watchdog timer [restraint-error-quark, 4]

But we would expect according to src/errors.h rather RESTRAINT_TASK_RUNNER_WATCHDOG_ERROR, i.e. exit code 4

@idorax
Copy link

idorax commented Dec 21, 2022

The error message like:

Recipe 1 exceeded lab watchdog timer [restraint-error-quark, 4]

is from:

  • https://github.com/restraint-harness/restraint/blob/master/src/client.c#L410
    403	gboolean
    404	watchdog_timeout_cb (gpointer user_data)
    405	{
    406	    RecipeData *recipe_data = (RecipeData*) user_data;
    407	    AppData *app_data = recipe_data->app_data;
    408	    if (! app_data->error) {
    409	        g_set_error (&app_data->error, RESTRAINT_ERROR,
    410	                     RESTRAINT_TASK_RUNNER_WATCHDOG_ERROR,
    411	                     "Recipe %d exceeded lab watchdog timer",
    412	                     recipe_data->recipe_id);
    413	    }
    414	    g_cancellable_cancel (recipe_data->cancellable);
    415	    return FALSE;
    416	}

And we can get the error code via app_data->error->code, but main() in src/client.c just returns like:

But we would expect according to src/errors.h rather RESTRAINT_TASK_RUNNER_WATCHDOG_ERROR, i.e. exit code 4

Hi @thrix, the restraint command should exit with code RESTRAINT_TASK_RUNNER_WATCHDOG_ERROR instead of EXIT_FAILURE if it is on watchdog timeout, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants