public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] runner: Exit with 2 when overall timeout exceeded
@ 2019-02-18 13:10 Petri Latvala
  2019-02-18 13:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Petri Latvala @ 2019-02-18 13:10 UTC (permalink / raw)
  To: igt-dev; +Cc: Tomi Sarvela, Petri Latvala

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-18 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-18 13:10 [igt-dev] [PATCH i-g-t] runner: Exit with 2 when overall timeout exceeded Petri Latvala
2019-02-18 13:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox