public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/3] runner: Handle outputs before checking for timeout
@ 2020-03-12  9:59 Petri Latvala
  2020-03-12  9:59 ` [igt-dev] [PATCH i-g-t 2/3] runner: Dump the rest of dmesg also when child refuses to die Petri Latvala
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Petri Latvala @ 2020-03-12  9:59 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 runner/executor.c | 72 +++++++++++++++++++++++------------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 72e45b65..28b8a443 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -828,42 +828,6 @@ static int monitor_output(pid_t child,
 
 		igt_gettime(&time_now);
 
-		timeout_reason = need_to_timeout(settings, killed, tainted(&taints),
-						 igt_time_elapsed(&time_last_activity, &time_now),
-						 igt_time_elapsed(&time_last_subtest, &time_now),
-						 igt_time_elapsed(&time_killed, &time_now));
-
-		if (timeout_reason) {
-			if (killed == SIGKILL) {
-				/* Nothing that can be done, really. Let's tell the caller we want to abort. */
-
-				if (settings->log_level >= LOG_LEVEL_NORMAL) {
-					errf("Child refuses to die, tainted 0x%lx. Aborting.\n",
-					     taints);
-					if (kill(child, 0) && errno == ESRCH)
-						errf("The test process no longer exists, "
-						     "but we didn't get informed of its demise...\n");
-				}
-
-				close_watchdogs(settings);
-				free(outbuf);
-				close(outfd);
-				close(errfd);
-				close(kmsgfd);
-				return -1;
-			}
-
-			if (settings->log_level >= LOG_LEVEL_NORMAL) {
-				outf("%s", timeout_reason);
-				fflush(stdout);
-			}
-
-			killed = next_kill_signal(killed);
-			if (!kill_child(killed, child))
-				return -1;
-			time_killed = time_now;
-		}
-
 		/* TODO: Refactor these handlers to their own functions */
 		if (outfd >= 0 && FD_ISSET(outfd, &set)) {
 			char *newline;
@@ -1072,6 +1036,42 @@ static int monitor_output(pid_t child,
 			child = 0;
 			sigfd = -1; /* we are dying, no signal handling for now */
 		}
+
+		timeout_reason = need_to_timeout(settings, killed, tainted(&taints),
+						 igt_time_elapsed(&time_last_activity, &time_now),
+						 igt_time_elapsed(&time_last_subtest, &time_now),
+						 igt_time_elapsed(&time_killed, &time_now));
+
+		if (timeout_reason) {
+			if (killed == SIGKILL) {
+				/* Nothing that can be done, really. Let's tell the caller we want to abort. */
+
+				if (settings->log_level >= LOG_LEVEL_NORMAL) {
+					errf("Child refuses to die, tainted 0x%lx. Aborting.\n",
+					     taints);
+					if (kill(child, 0) && errno == ESRCH)
+						errf("The test process no longer exists, "
+						     "but we didn't get informed of its demise...\n");
+				}
+
+				close_watchdogs(settings);
+				free(outbuf);
+				close(outfd);
+				close(errfd);
+				close(kmsgfd);
+				return -1;
+			}
+
+			if (settings->log_level >= LOG_LEVEL_NORMAL) {
+				outf("%s", timeout_reason);
+				fflush(stdout);
+			}
+
+			killed = next_kill_signal(killed);
+			if (!kill_child(killed, child))
+				return -1;
+			time_killed = time_now;
+		}
 	}
 
 	dump_dmesg(kmsgfd, outputs[_F_DMESG]);
-- 
2.20.1

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

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

end of thread, other threads:[~2020-03-13  4:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-12  9:59 [igt-dev] [PATCH i-g-t 1/3] runner: Handle outputs before checking for timeout Petri Latvala
2020-03-12  9:59 ` [igt-dev] [PATCH i-g-t 2/3] runner: Dump the rest of dmesg also when child refuses to die Petri Latvala
2020-03-12  9:59 ` [igt-dev] [PATCH i-g-t 3/3] runner: Read all kernel logs when there are logs Petri Latvala
2020-03-12 10:09   ` Chris Wilson
2020-03-12 11:11 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] runner: Handle outputs before checking for timeout Patchwork
2020-03-12 11:52 ` Patchwork
2020-03-12 11:57 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-03-13  4:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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