public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>,
	Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t] runner: Exit with 2 when overall timeout exceeded
Date: Mon, 18 Feb 2019 15:10:14 +0200	[thread overview]
Message-ID: <20190218131014.13128-1-petri.latvala@intel.com> (raw)

That leaves exitcode 1 for aborts and initialization failures. Should
maybe differentiate those as well. Not to mention document the exit
codes.

Also fix igt_resume to follow suit to igt_runner: Generate
results.json even when aborting or exceeding overall-timeout.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
---
 runner/resume.c | 15 ++++++++++++---
 runner/runner.c |  8 ++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/runner/resume.c b/runner/resume.c
index b3a2a71e..d5a20e80 100644
--- a/runner/resume.c
+++ b/runner/resume.c
@@ -15,6 +15,7 @@ int main(int argc, char **argv)
 	struct settings settings;
 	struct job_list job_list;
 	struct execute_state state;
+	int exitcode = 0;
 	int dirfd;
 
 	init_settings(&settings);
@@ -35,13 +36,21 @@ int main(int argc, char **argv)
 	}
 
 	if (!execute(&state, &settings, &job_list)) {
-		return 1;
+		exitcode = 1;
+	}
+
+	if (state.time_left == 0.0) {
+		/*
+		 * Overall timeout happened. Results generation can
+		 * override this
+		 */
+		exitcode = 2;
 	}
 
 	if (!generate_results_path(settings.results_path)) {
-		return 1;
+		exitcode = 1;
 	}
 
 	printf("Done.\n");
-	return 0;
+	return exitcode;
 }
diff --git a/runner/runner.c b/runner/runner.c
index 013af551..e1a6ccba 100644
--- a/runner/runner.c
+++ b/runner/runner.c
@@ -32,6 +32,14 @@ int main(int argc, char **argv)
 		exitcode = 1;
 	}
 
+	if (state.time_left == 0.0) {
+		/*
+		 * Overall timeout happened. Results generation can
+		 * override this
+		 */
+		exitcode = 2;
+	}
+
 	if (!generate_results_path(settings.results_path)) {
 		exitcode = 1;
 	}
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-02-18 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18 13:10 Petri Latvala [this message]
2019-02-18 13:36 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Exit with 2 when overall timeout exceeded Patchwork
2019-02-18 14:23 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
2019-02-18 17:29 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190218131014.13128-1-petri.latvala@intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tomi.p.sarvela@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox