public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test
@ 2022-12-21 11:42 Petri Latvala
  2022-12-21 13:30 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Correctly handle abort before first test (rev4) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Petri Latvala @ 2022-12-21 11:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Chris Wilson

Don't leave the execution in a "please resume me" state if bootup
causes an abort condition. Especially handle the case of abort on
bootup when resuming correctly, so that it doesn't attempt to run a
test on a tainted kernel if we've explicitly configured the runner to
not execute when there's a taint.

v2: Fudge the results directory instead to get the desired results:
    runner exits with nonzero, and resuming exits with "all done" instead
    of executing anything.

v3: Use faccessat instead of open+close, use less magic strings,
    remember to close fds (Chris)

v4: Use GRACEFUL_EXITCODE in monitor_output, remove the 'resuming'
    field (why was it a double?!). (Ryszard)
    Stop trying to execute if all tests are already run, to avoid a
    crash in environment validation.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arek@hiler.eu>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Ryszard Knop <ryszard.knop@intel.com>
---
 runner/executor.c | 57 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 54 insertions(+), 3 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index d2253082..e954c23e 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -37,6 +37,7 @@
 
 #define KMSG_HEADER "[IGT] "
 #define KMSG_WARN 4
+#define GRACEFUL_EXITCODE -SIGHUP
 
 static struct {
 	int *fds;
@@ -1249,7 +1250,7 @@ static int monitor_output(pid_t child,
 					} else {
 						dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
 							EXECUTOR_EXIT,
-							-SIGHUP, 0.0);
+							GRACEFUL_EXITCODE, 0.0);
 						if (settings->sync)
 							fdatasync(outputs[_F_JOURNAL]);
 					}
@@ -1720,6 +1721,41 @@ out_dirfd:
 	return result;
 }
 
+static void fill_results_directory_with_notruns(struct job_list *list,
+						int resdirfd)
+{
+	int outputs[_F_LAST];
+	char name[32];
+	int dirfd;
+	size_t i;
+
+	for (i = 0; i < list->size; i++) {
+		snprintf(name, sizeof(name), "%zd", i);
+
+		if (faccessat(resdirfd, name, F_OK, 0) == 0)
+			continue;
+
+		mkdirat(resdirfd, name, 0777);
+		dirfd = openat(resdirfd, name, O_DIRECTORY | O_RDONLY);
+		if (dirfd < 0) {
+			errf("Error accessing individual test result directory\n");
+			return;
+		}
+
+		if (!open_output_files(dirfd, outputs, true)) {
+			errf("Error opening output files\n");
+			close(dirfd);
+			return;
+		}
+
+		dprintf(outputs[_F_OUT], "Forced notrun result because of abort condition on bootup\n");
+		dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n", EXECUTOR_EXIT, GRACEFUL_EXITCODE, 0.0);
+
+		close_outputs(outputs);
+		close(dirfd);
+	}
+}
+
 static int remove_file(int dirfd, const char *name)
 {
 	return unlinkat(dirfd, name, 0) && errno != ENOENT;
@@ -1845,7 +1881,6 @@ bool initialize_execute_state_from_resume(int dirfd,
 	clear_settings(settings);
 	free_job_list(list);
 	memset(state, 0, sizeof(*state));
-	state->resuming = true;
 
 	if (!read_settings_from_dir(settings, dirfd) ||
 	    !read_job_list(list, dirfd)) {
@@ -2183,6 +2218,11 @@ bool execute(struct execute_state *state,
 		return true;
 	}
 
+	if (state->next >= job_list->size) {
+		outf("All tests already executed.\n");
+		return true;
+	}
+
 	igt_list_for_each_entry(env_var, &settings->env_vars, link) {
 		setenv(env_var->key, env_var->value, 1);
 	}
@@ -2271,7 +2311,7 @@ bool execute(struct execute_state *state,
 	close(unamefd);
 
 	/* Check if we're already in abort-state at bootup */
-	if (!state->resuming) {
+	{
 		char *reason;
 
 		if ((reason = need_to_abort(settings)) != NULL) {
@@ -2280,6 +2320,17 @@ bool execute(struct execute_state *state,
 			free(reason);
 			free(nexttest);
 
+			/*
+			 * If an abort condition happened at bootup,
+			 * assume that it happens on every boot,
+			 * making this test execution impossible.
+			 * Write stuff to the results directory
+			 * indicating this so resuming immediately
+			 * finishes instead of getting stuck in an
+			 * infinite reboot loop.
+			 */
+			fill_results_directory_with_notruns(job_list, resdirfd);
+
 			status = false;
 
 			goto end;
-- 
2.30.2

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

* [igt-dev] ✓ Fi.CI.BAT: success for runner: Correctly handle abort before first test (rev4)
  2022-12-21 11:42 [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test Petri Latvala
@ 2022-12-21 13:30 ` Patchwork
  2022-12-21 15:24 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2022-12-21 13:30 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 6338 bytes --]

== Series Details ==

Series: runner: Correctly handle abort before first test (rev4)
URL   : https://patchwork.freedesktop.org/series/96659/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12517 -> IGTPW_8259
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/index.html

Participating hosts (41 -> 43)
------------------------------

  Additional (2): bat-adln-1 bat-atsm-1 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8259:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_selftest@live@hangcheck:
    - {bat-atsm-1}:       NOTRUN -> [FAIL][1] +37 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/bat-atsm-1/igt@i915_selftest@live@hangcheck.html

  * igt@kms_pipe_crc_basic@read-crc-frame-sequence:
    - {bat-atsm-1}:       NOTRUN -> [SKIP][2] +7 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/bat-atsm-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence.html

  
Known issues
------------

  Here are the changes found in IGTPW_8259 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-ilk-650:         NOTRUN -> [SKIP][3] ([fdo#109271]) +20 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/fi-ilk-650/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@i915_selftest@live@gt_heartbeat:
    - fi-apl-guc:         [PASS][4] -> [DMESG-FAIL][5] ([i915#5334])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - bat-dg1-5:          NOTRUN -> [SKIP][6] ([fdo#111827])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/bat-dg1-5/igt@kms_chamelium@common-hpd-after-suspend.html

  * igt@kms_chamelium@dp-hpd-fast:
    - fi-ilk-650:         NOTRUN -> [SKIP][7] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/fi-ilk-650/igt@kms_chamelium@dp-hpd-fast.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
    - fi-bsw-kefka:       [PASS][8] -> [FAIL][9] ([i915#6298])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@migrate:
    - {bat-adlp-6}:       [DMESG-FAIL][10] ([i915#7699]) -> [PASS][11]
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/bat-adlp-6/igt@i915_selftest@live@migrate.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/bat-adlp-6/igt@i915_selftest@live@migrate.html

  * igt@i915_selftest@live@mman:
    - fi-rkl-guc:         [TIMEOUT][12] ([i915#6794]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/fi-rkl-guc/igt@i915_selftest@live@mman.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/fi-rkl-guc/igt@i915_selftest@live@mman.html

  * igt@i915_selftest@live@workarounds:
    - bat-dg1-5:          [INCOMPLETE][14] ([i915#4983]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/bat-dg1-5/igt@i915_selftest@live@workarounds.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/bat-dg1-5/igt@i915_selftest@live@workarounds.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5174]: https://gitlab.freedesktop.org/drm/intel/issues/5174
  [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
  [i915#5775]: https://gitlab.freedesktop.org/drm/intel/issues/5775
  [i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
  [i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
  [i915#6794]: https://gitlab.freedesktop.org/drm/intel/issues/6794
  [i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
  [i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
  [i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7100 -> IGTPW_8259

  CI-20190529: 20190529
  CI_DRM_12517: 0ccc7ebce461c057c63b5879b8ace1a34ea8423a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8259: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/index.html
  IGT_7100: 04466b02a9b5356d266a899daa5183c1f6b0e20f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/index.html

[-- Attachment #2: Type: text/html, Size: 6043 bytes --]

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

* [igt-dev] ✓ Fi.CI.IGT: success for runner: Correctly handle abort before first test (rev4)
  2022-12-21 11:42 [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test Petri Latvala
  2022-12-21 13:30 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Correctly handle abort before first test (rev4) Patchwork
@ 2022-12-21 15:24 ` Patchwork
  2022-12-22 12:11 ` [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test Kamil Konieczny
  2023-01-05 19:25 ` Kamil Konieczny
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2022-12-21 15:24 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 14409 bytes --]

== Series Details ==

Series: runner: Correctly handle abort before first test (rev4)
URL   : https://patchwork.freedesktop.org/series/96659/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12517_full -> IGTPW_8259_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/index.html

Participating hosts (14 -> 10)
------------------------------

  Missing    (4): pig-skl-6260u pig-kbl-iris shard-tglu-10 pig-glk-j5005 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8259_full:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@vc4/vc4_tiling@get-bad-modifier:
    - {shard-rkl}:        NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-4/igt@vc4/vc4_tiling@get-bad-modifier.html

  
Known issues
------------

  Here are the changes found in IGTPW_8259_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@kms_big_fb@4-tiled-16bpp-rotate-270:
    - shard-glk:          NOTRUN -> [SKIP][2] ([fdo#109271]) +15 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-glk4/igt@kms_big_fb@4-tiled-16bpp-rotate-270.html

  * igt@kms_ccs@pipe-c-missing-ccs-buffer-y_tiled_gen12_mc_ccs:
    - shard-glk:          NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#3886])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-glk2/igt@kms_ccs@pipe-c-missing-ccs-buffer-y_tiled_gen12_mc_ccs.html

  * igt@kms_chamelium@hdmi-hpd-enable-disable-mode:
    - shard-glk:          NOTRUN -> [SKIP][4] ([fdo#109271] / [fdo#111827])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-glk6/igt@kms_chamelium@hdmi-hpd-enable-disable-mode.html

  * igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-sf:
    - shard-glk:          NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#658])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-glk3/igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-sf.html

  
#### Possible fixes ####

  * igt@fbdev@nullptr:
    - {shard-rkl}:        [SKIP][6] ([i915#2582]) -> [PASS][7] +1 similar issue
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-5/igt@fbdev@nullptr.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-3/igt@fbdev@nullptr.html

  * igt@gem_eio@suspend:
    - {shard-rkl}:        [FAIL][8] ([i915#7052]) -> [PASS][9]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-3/igt@gem_eio@suspend.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-1/igt@gem_eio@suspend.html

  * igt@gem_exec_reloc@basic-write-read-noreloc:
    - {shard-rkl}:        [SKIP][10] ([i915#3281]) -> [PASS][11] +4 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-4/igt@gem_exec_reloc@basic-write-read-noreloc.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-5/igt@gem_exec_reloc@basic-write-read-noreloc.html

  * igt@gem_pread@snoop:
    - {shard-rkl}:        [SKIP][12] ([i915#3282]) -> [PASS][13] +3 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-4/igt@gem_pread@snoop.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-5/igt@gem_pread@snoop.html

  * igt@gen9_exec_parse@bb-start-far:
    - {shard-rkl}:        [SKIP][14] ([i915#2527]) -> [PASS][15] +1 similar issue
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-3/igt@gen9_exec_parse@bb-start-far.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-5/igt@gen9_exec_parse@bb-start-far.html

  * igt@i915_pm_rpm@drm-resources-equal:
    - {shard-rkl}:        [SKIP][16] ([fdo#109308]) -> [PASS][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-5/igt@i915_pm_rpm@drm-resources-equal.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-6/igt@i915_pm_rpm@drm-resources-equal.html

  * igt@kms_big_fb@linear-32bpp-rotate-180:
    - {shard-rkl}:        [SKIP][18] ([i915#1845] / [i915#4098]) -> [PASS][19] +9 similar issues
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-2/igt@kms_big_fb@linear-32bpp-rotate-180.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-6/igt@kms_big_fb@linear-32bpp-rotate-180.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip:
    - {shard-tglu}:       [SKIP][20] ([i915#7651]) -> [PASS][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-tglu-6/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-tglu-5/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
    - shard-glk:          [FAIL][22] ([i915#72]) -> [PASS][23]
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-glk4/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-glk2/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-pgflip-blt:
    - {shard-tglu}:       [SKIP][24] ([i915#1849]) -> [PASS][25]
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-tglu-6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-pgflip-blt.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-tglu-5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-pgflip-blt.html

  * igt@kms_frontbuffer_tracking@psr-rgb101010-draw-pwrite:
    - {shard-rkl}:        [SKIP][26] ([i915#1849] / [i915#4098]) -> [PASS][27] +9 similar issues
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-5/igt@kms_frontbuffer_tracking@psr-rgb101010-draw-pwrite.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-6/igt@kms_frontbuffer_tracking@psr-rgb101010-draw-pwrite.html

  * igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes:
    - {shard-rkl}:        [SKIP][28] ([i915#3558]) -> [PASS][29] +1 similar issue
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-4/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-6/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes.html

  * igt@kms_properties@crtc-properties-legacy:
    - {shard-rkl}:        [SKIP][30] ([i915#1849]) -> [PASS][31]
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-5/igt@kms_properties@crtc-properties-legacy.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-6/igt@kms_properties@crtc-properties-legacy.html

  * igt@kms_properties@plane-properties-legacy:
    - {shard-dg1}:        [DMESG-WARN][32] -> [PASS][33]
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-dg1-18/igt@kms_properties@plane-properties-legacy.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-dg1-18/igt@kms_properties@plane-properties-legacy.html

  * igt@kms_psr@sprite_mmap_gtt:
    - {shard-rkl}:        [SKIP][34] ([i915#1072]) -> [PASS][35]
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-5/igt@kms_psr@sprite_mmap_gtt.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-6/igt@kms_psr@sprite_mmap_gtt.html

  * igt@testdisplay:
    - {shard-rkl}:        [SKIP][36] ([i915#4098]) -> [PASS][37]
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12517/shard-rkl-4/igt@testdisplay.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/shard-rkl-6/igt@testdisplay.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1257]: https://gitlab.freedesktop.org/drm/intel/issues/1257
  [i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
  [i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
  [i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
  [i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
  [i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
  [i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
  [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
  [i915#3528]: https://gitlab.freedesktop.org/drm/intel/issues/3528
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
  [i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
  [i915#3810]: https://gitlab.freedesktop.org/drm/intel/issues/3810
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#5122]: https://gitlab.freedesktop.org/drm/intel/issues/5122
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
  [i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
  [i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
  [i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
  [i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
  [i915#7052]: https://gitlab.freedesktop.org/drm/intel/issues/7052
  [i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
  [i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
  [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
  [i915#7651]: https://gitlab.freedesktop.org/drm/intel/issues/7651
  [i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7100 -> IGTPW_8259
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_12517: 0ccc7ebce461c057c63b5879b8ace1a34ea8423a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8259: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/index.html
  IGT_7100: 04466b02a9b5356d266a899daa5183c1f6b0e20f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8259/index.html

[-- Attachment #2: Type: text/html, Size: 11531 bytes --]

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

* Re: [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test
  2022-12-21 11:42 [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test Petri Latvala
  2022-12-21 13:30 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Correctly handle abort before first test (rev4) Patchwork
  2022-12-21 15:24 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2022-12-22 12:11 ` Kamil Konieczny
  2023-01-05 19:25 ` Kamil Konieczny
  3 siblings, 0 replies; 6+ messages in thread
From: Kamil Konieczny @ 2022-12-22 12:11 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Chris Wilson

On 2022-12-21 at 13:42:13 +0200, Petri Latvala wrote:
> Don't leave the execution in a "please resume me" state if bootup
> causes an abort condition. Especially handle the case of abort on
> bootup when resuming correctly, so that it doesn't attempt to run a
> test on a tainted kernel if we've explicitly configured the runner to
> not execute when there's a taint.
> 
> v2: Fudge the results directory instead to get the desired results:
>     runner exits with nonzero, and resuming exits with "all done" instead
>     of executing anything.
> 
> v3: Use faccessat instead of open+close, use less magic strings,
>     remember to close fds (Chris)
> 
> v4: Use GRACEFUL_EXITCODE in monitor_output, remove the 'resuming'
>     field (why was it a double?!). (Ryszard)
>     Stop trying to execute if all tests are already run, to avoid a
>     crash in environment validation.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arek@hiler.eu>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Ryszard Knop <ryszard.knop@intel.com>

Acked-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  runner/executor.c | 57 ++++++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 54 insertions(+), 3 deletions(-)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index d2253082..e954c23e 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -37,6 +37,7 @@
>  
>  #define KMSG_HEADER "[IGT] "
>  #define KMSG_WARN 4
> +#define GRACEFUL_EXITCODE -SIGHUP
>  
>  static struct {
>  	int *fds;
> @@ -1249,7 +1250,7 @@ static int monitor_output(pid_t child,
>  					} else {
>  						dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
>  							EXECUTOR_EXIT,
> -							-SIGHUP, 0.0);
> +							GRACEFUL_EXITCODE, 0.0);
>  						if (settings->sync)
>  							fdatasync(outputs[_F_JOURNAL]);
>  					}
> @@ -1720,6 +1721,41 @@ out_dirfd:
>  	return result;
>  }
>  
> +static void fill_results_directory_with_notruns(struct job_list *list,
> +						int resdirfd)
> +{
> +	int outputs[_F_LAST];
> +	char name[32];
> +	int dirfd;
> +	size_t i;
> +
> +	for (i = 0; i < list->size; i++) {
> +		snprintf(name, sizeof(name), "%zd", i);
> +
> +		if (faccessat(resdirfd, name, F_OK, 0) == 0)
> +			continue;
> +
> +		mkdirat(resdirfd, name, 0777);
> +		dirfd = openat(resdirfd, name, O_DIRECTORY | O_RDONLY);
> +		if (dirfd < 0) {
> +			errf("Error accessing individual test result directory\n");
> +			return;
> +		}
> +
> +		if (!open_output_files(dirfd, outputs, true)) {
> +			errf("Error opening output files\n");
> +			close(dirfd);
> +			return;
> +		}
> +
> +		dprintf(outputs[_F_OUT], "Forced notrun result because of abort condition on bootup\n");
> +		dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n", EXECUTOR_EXIT, GRACEFUL_EXITCODE, 0.0);
> +
> +		close_outputs(outputs);
> +		close(dirfd);
> +	}
> +}
> +
>  static int remove_file(int dirfd, const char *name)
>  {
>  	return unlinkat(dirfd, name, 0) && errno != ENOENT;
> @@ -1845,7 +1881,6 @@ bool initialize_execute_state_from_resume(int dirfd,
>  	clear_settings(settings);
>  	free_job_list(list);
>  	memset(state, 0, sizeof(*state));
> -	state->resuming = true;
>  
>  	if (!read_settings_from_dir(settings, dirfd) ||
>  	    !read_job_list(list, dirfd)) {
> @@ -2183,6 +2218,11 @@ bool execute(struct execute_state *state,
>  		return true;
>  	}
>  
> +	if (state->next >= job_list->size) {
> +		outf("All tests already executed.\n");
> +		return true;
> +	}
> +
>  	igt_list_for_each_entry(env_var, &settings->env_vars, link) {
>  		setenv(env_var->key, env_var->value, 1);
>  	}
> @@ -2271,7 +2311,7 @@ bool execute(struct execute_state *state,
>  	close(unamefd);
>  
>  	/* Check if we're already in abort-state at bootup */
> -	if (!state->resuming) {
> +	{
>  		char *reason;
>  
>  		if ((reason = need_to_abort(settings)) != NULL) {
> @@ -2280,6 +2320,17 @@ bool execute(struct execute_state *state,
>  			free(reason);
>  			free(nexttest);
>  
> +			/*
> +			 * If an abort condition happened at bootup,
> +			 * assume that it happens on every boot,
> +			 * making this test execution impossible.
> +			 * Write stuff to the results directory
> +			 * indicating this so resuming immediately
> +			 * finishes instead of getting stuck in an
> +			 * infinite reboot loop.
> +			 */
> +			fill_results_directory_with_notruns(job_list, resdirfd);
> +
>  			status = false;
>  
>  			goto end;
> -- 
> 2.30.2
> 

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

* Re: [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test
  2022-12-21 11:42 [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test Petri Latvala
                   ` (2 preceding siblings ...)
  2022-12-22 12:11 ` [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test Kamil Konieczny
@ 2023-01-05 19:25 ` Kamil Konieczny
  2023-01-09  9:49   ` Petri Latvala
  3 siblings, 1 reply; 6+ messages in thread
From: Kamil Konieczny @ 2023-01-05 19:25 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Chris Wilson

Hi Petri,

small nits, see below.

On 2022-12-21 at 13:42:13 +0200, Petri Latvala wrote:
> Don't leave the execution in a "please resume me" state if bootup
> causes an abort condition. Especially handle the case of abort on
> bootup when resuming correctly, so that it doesn't attempt to run a
> test on a tainted kernel if we've explicitly configured the runner to
> not execute when there's a taint.
> 
> v2: Fudge the results directory instead to get the desired results:
>     runner exits with nonzero, and resuming exits with "all done" instead
>     of executing anything.
> 
> v3: Use faccessat instead of open+close, use less magic strings,
>     remember to close fds (Chris)
> 
> v4: Use GRACEFUL_EXITCODE in monitor_output, remove the 'resuming'
>     field (why was it a double?!). (Ryszard)
>     Stop trying to execute if all tests are already run, to avoid a
>     crash in environment validation.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arek@hiler.eu>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Ryszard Knop <ryszard.knop@intel.com>
> ---
>  runner/executor.c | 57 ++++++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 54 insertions(+), 3 deletions(-)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index d2253082..e954c23e 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -37,6 +37,7 @@
>  
>  #define KMSG_HEADER "[IGT] "
>  #define KMSG_WARN 4
> +#define GRACEFUL_EXITCODE -SIGHUP
>  
>  static struct {
>  	int *fds;
> @@ -1249,7 +1250,7 @@ static int monitor_output(pid_t child,
>  					} else {
>  						dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
----------------------------------------------------------------------------------- ^
Maybe instead of %.3fs just put here 0.0s ?

>  							EXECUTOR_EXIT,
> -							-SIGHUP, 0.0);
> +							GRACEFUL_EXITCODE, 0.0);
-------------------------------------------------------------------------- ^
Then you can drop 0.0 here.

>  						if (settings->sync)
>  							fdatasync(outputs[_F_JOURNAL]);
>  					}
> @@ -1720,6 +1721,41 @@ out_dirfd:
>  	return result;
>  }
>  
> +static void fill_results_directory_with_notruns(struct job_list *list,
> +						int resdirfd)
> +{
> +	int outputs[_F_LAST];
> +	char name[32];
> +	int dirfd;
> +	size_t i;
> +
> +	for (i = 0; i < list->size; i++) {
> +		snprintf(name, sizeof(name), "%zd", i);
> +
> +		if (faccessat(resdirfd, name, F_OK, 0) == 0)
> +			continue;
> +
> +		mkdirat(resdirfd, name, 0777);
> +		dirfd = openat(resdirfd, name, O_DIRECTORY | O_RDONLY);
> +		if (dirfd < 0) {
> +			errf("Error accessing individual test result directory\n");
> +			return;
> +		}
> +
> +		if (!open_output_files(dirfd, outputs, true)) {
> +			errf("Error opening output files\n");
> +			close(dirfd);
> +			return;
> +		}
> +
> +		dprintf(outputs[_F_OUT], "Forced notrun result because of abort condition on bootup\n");
> +		dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n", EXECUTOR_EXIT, GRACEFUL_EXITCODE, 0.0);
--------------------------------------------------- ^ ------------------------------------------ ^
Same here, you can just put here 0.0s instead.

> +
> +		close_outputs(outputs);
> +		close(dirfd);
> +	}
> +}
> +
>  static int remove_file(int dirfd, const char *name)
>  {
>  	return unlinkat(dirfd, name, 0) && errno != ENOENT;
> @@ -1845,7 +1881,6 @@ bool initialize_execute_state_from_resume(int dirfd,
>  	clear_settings(settings);
>  	free_job_list(list);
>  	memset(state, 0, sizeof(*state));
> -	state->resuming = true;

It's not used anywhere so remove it from header.

With that fixed you can add my r-b,

Regards,
Kamil

>  
>  	if (!read_settings_from_dir(settings, dirfd) ||
>  	    !read_job_list(list, dirfd)) {
> @@ -2183,6 +2218,11 @@ bool execute(struct execute_state *state,
>  		return true;
>  	}
>  
> +	if (state->next >= job_list->size) {
> +		outf("All tests already executed.\n");
> +		return true;
> +	}
> +
>  	igt_list_for_each_entry(env_var, &settings->env_vars, link) {
>  		setenv(env_var->key, env_var->value, 1);
>  	}
> @@ -2271,7 +2311,7 @@ bool execute(struct execute_state *state,
>  	close(unamefd);
>  
>  	/* Check if we're already in abort-state at bootup */
> -	if (!state->resuming) {
> +	{
>  		char *reason;
>  
>  		if ((reason = need_to_abort(settings)) != NULL) {
> @@ -2280,6 +2320,17 @@ bool execute(struct execute_state *state,
>  			free(reason);
>  			free(nexttest);
>  
> +			/*
> +			 * If an abort condition happened at bootup,
> +			 * assume that it happens on every boot,
> +			 * making this test execution impossible.
> +			 * Write stuff to the results directory
> +			 * indicating this so resuming immediately
> +			 * finishes instead of getting stuck in an
> +			 * infinite reboot loop.
> +			 */
> +			fill_results_directory_with_notruns(job_list, resdirfd);
> +
>  			status = false;
>  
>  			goto end;
> -- 
> 2.30.2
> 

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

* Re: [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test
  2023-01-05 19:25 ` Kamil Konieczny
@ 2023-01-09  9:49   ` Petri Latvala
  0 siblings, 0 replies; 6+ messages in thread
From: Petri Latvala @ 2023-01-09  9:49 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Arkadiusz Hiler, Chris Wilson,
	Ryszard Knop

On Thu, Jan 05, 2023 at 08:25:37PM +0100, Kamil Konieczny wrote:
> Hi Petri,
> 
> small nits, see below.
> 
> On 2022-12-21 at 13:42:13 +0200, Petri Latvala wrote:
> > Don't leave the execution in a "please resume me" state if bootup
> > causes an abort condition. Especially handle the case of abort on
> > bootup when resuming correctly, so that it doesn't attempt to run a
> > test on a tainted kernel if we've explicitly configured the runner to
> > not execute when there's a taint.
> > 
> > v2: Fudge the results directory instead to get the desired results:
> >     runner exits with nonzero, and resuming exits with "all done" instead
> >     of executing anything.
> > 
> > v3: Use faccessat instead of open+close, use less magic strings,
> >     remember to close fds (Chris)
> > 
> > v4: Use GRACEFUL_EXITCODE in monitor_output, remove the 'resuming'
> >     field (why was it a double?!). (Ryszard)
> >     Stop trying to execute if all tests are already run, to avoid a
> >     crash in environment validation.
> > 
> > Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> > Cc: Arkadiusz Hiler <arek@hiler.eu>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > Cc: Ryszard Knop <ryszard.knop@intel.com>
> > ---
> >  runner/executor.c | 57 ++++++++++++++++++++++++++++++++++++++++++++---
> >  1 file changed, 54 insertions(+), 3 deletions(-)
> > 
> > diff --git a/runner/executor.c b/runner/executor.c
> > index d2253082..e954c23e 100644
> > --- a/runner/executor.c
> > +++ b/runner/executor.c
> > @@ -37,6 +37,7 @@
> >  
> >  #define KMSG_HEADER "[IGT] "
> >  #define KMSG_WARN 4
> > +#define GRACEFUL_EXITCODE -SIGHUP
> >  
> >  static struct {
> >  	int *fds;
> > @@ -1249,7 +1250,7 @@ static int monitor_output(pid_t child,
> >  					} else {
> >  						dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
> ----------------------------------------------------------------------------------- ^
> Maybe instead of %.3fs just put here 0.0s ?
> 
> >  							EXECUTOR_EXIT,
> > -							-SIGHUP, 0.0);
> > +							GRACEFUL_EXITCODE, 0.0);
> -------------------------------------------------------------------------- ^
> Then you can drop 0.0 here.
> 
> >  						if (settings->sync)
> >  							fdatasync(outputs[_F_JOURNAL]);
> >  					}
> > @@ -1720,6 +1721,41 @@ out_dirfd:
> >  	return result;
> >  }
> >  
> > +static void fill_results_directory_with_notruns(struct job_list *list,
> > +						int resdirfd)
> > +{
> > +	int outputs[_F_LAST];
> > +	char name[32];
> > +	int dirfd;
> > +	size_t i;
> > +
> > +	for (i = 0; i < list->size; i++) {
> > +		snprintf(name, sizeof(name), "%zd", i);
> > +
> > +		if (faccessat(resdirfd, name, F_OK, 0) == 0)
> > +			continue;
> > +
> > +		mkdirat(resdirfd, name, 0777);
> > +		dirfd = openat(resdirfd, name, O_DIRECTORY | O_RDONLY);
> > +		if (dirfd < 0) {
> > +			errf("Error accessing individual test result directory\n");
> > +			return;
> > +		}
> > +
> > +		if (!open_output_files(dirfd, outputs, true)) {
> > +			errf("Error opening output files\n");
> > +			close(dirfd);
> > +			return;
> > +		}
> > +
> > +		dprintf(outputs[_F_OUT], "Forced notrun result because of abort condition on bootup\n");
> > +		dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n", EXECUTOR_EXIT, GRACEFUL_EXITCODE, 0.0);
> --------------------------------------------------- ^ ------------------------------------------ ^
> Same here, you can just put here 0.0s instead.
> 
> > +
> > +		close_outputs(outputs);
> > +		close(dirfd);
> > +	}
> > +}
> > +
> >  static int remove_file(int dirfd, const char *name)
> >  {
> >  	return unlinkat(dirfd, name, 0) && errno != ENOENT;
> > @@ -1845,7 +1881,6 @@ bool initialize_execute_state_from_resume(int dirfd,
> >  	clear_settings(settings);
> >  	free_job_list(list);
> >  	memset(state, 0, sizeof(*state));
> > -	state->resuming = true;
> 
> It's not used anywhere so remove it from header.

I in fact did remove it! But then I forgot to git add...


-- 
Petri Latvala


> 
> With that fixed you can add my r-b,
> 
> Regards,
> Kamil
> 
> >  
> >  	if (!read_settings_from_dir(settings, dirfd) ||
> >  	    !read_job_list(list, dirfd)) {
> > @@ -2183,6 +2218,11 @@ bool execute(struct execute_state *state,
> >  		return true;
> >  	}
> >  
> > +	if (state->next >= job_list->size) {
> > +		outf("All tests already executed.\n");
> > +		return true;
> > +	}
> > +
> >  	igt_list_for_each_entry(env_var, &settings->env_vars, link) {
> >  		setenv(env_var->key, env_var->value, 1);
> >  	}
> > @@ -2271,7 +2311,7 @@ bool execute(struct execute_state *state,
> >  	close(unamefd);
> >  
> >  	/* Check if we're already in abort-state at bootup */
> > -	if (!state->resuming) {
> > +	{
> >  		char *reason;
> >  
> >  		if ((reason = need_to_abort(settings)) != NULL) {
> > @@ -2280,6 +2320,17 @@ bool execute(struct execute_state *state,
> >  			free(reason);
> >  			free(nexttest);
> >  
> > +			/*
> > +			 * If an abort condition happened at bootup,
> > +			 * assume that it happens on every boot,
> > +			 * making this test execution impossible.
> > +			 * Write stuff to the results directory
> > +			 * indicating this so resuming immediately
> > +			 * finishes instead of getting stuck in an
> > +			 * infinite reboot loop.
> > +			 */
> > +			fill_results_directory_with_notruns(job_list, resdirfd);
> > +
> >  			status = false;
> >  
> >  			goto end;
> > -- 
> > 2.30.2
> > 

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

end of thread, other threads:[~2023-01-09  9:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21 11:42 [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test Petri Latvala
2022-12-21 13:30 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Correctly handle abort before first test (rev4) Patchwork
2022-12-21 15:24 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2022-12-22 12:11 ` [igt-dev] [PATCH i-g-t v4] runner: Correctly handle abort before first test Kamil Konieczny
2023-01-05 19:25 ` Kamil Konieczny
2023-01-09  9:49   ` Petri Latvala

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