* [igt-dev] [PATCH i-g-t 1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose
@ 2020-05-04 11:26 Arkadiusz Hiler
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_core: Disallow nesting of igt_dynamic inside igt_dynamic Arkadiusz Hiler
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Arkadiusz Hiler @ 2020-05-04 11:26 UTC (permalink / raw)
To: igt-dev
Instead of ending the execution with cryptic assert let's actually print
a message explaining the reason and point towards igt_core's documentation.
I am sticking with assert() instead of abort() because of the
semi-useful stacktraces it produces.
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
lib/igt_core.c | 55 ++++++++++++++++++++++++++++++++++++++------------
1 file changed, 42 insertions(+), 13 deletions(-)
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 3f7b9f68..43f0ba8b 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -343,6 +343,21 @@ static bool stderr_needs_sentinel = false;
static int _igt_dynamic_tests_executed = -1;
+__attribute__((format(printf, 2, 3)))
+static void internal_assert(bool cond, const char *format, ...)
+{
+ if (!cond) {
+ va_list ap;
+
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ fprintf(stderr, "please refer to lib/igt_core documentation\n");
+
+ assert(0);
+ }
+}
+
const char *igt_test_name(void)
{
return command_str;
@@ -540,8 +555,12 @@ uint64_t igt_nsec_elapsed(struct timespec *start)
bool __igt_fixture(void)
{
- assert(!in_fixture);
- assert(test_with_subtests);
+ internal_assert(!in_fixture,
+ "nesting multiple igt_fixtures is invalid\n");
+ internal_assert(!in_subtest,
+ "nesting igt_fixture in igt_subtest is invalid\n");
+ internal_assert(test_with_subtests,
+ "igt_fixture in igt_simple_main is invalid\n");
if (igt_only_list_subtests())
return false;
@@ -1202,7 +1221,9 @@ static bool valid_name_for_subtest(const char *subtest_name)
*/
bool __igt_run_subtest(const char *subtest_name, const char *file, const int line)
{
- assert(!igt_can_fail());
+ internal_assert(!igt_can_fail(),
+ "igt_subtest can be nested only in igt_main"
+ " or igt_subtest_group\n");
if (!valid_name_for_subtest(subtest_name)) {
igt_critical("Invalid subtest name \"%s\".\n",
@@ -1257,8 +1278,8 @@ bool __igt_run_subtest(const char *subtest_name, const char *file, const int lin
bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name)
{
- assert(in_subtest);
- assert(_igt_dynamic_tests_executed >= 0);
+ internal_assert(in_subtest && _igt_dynamic_tests_executed >= 0,
+ "igt_dynamic is allowed only inside igt_subtest_with_dynamic\n");
if (!valid_name_for_subtest(dynamic_subtest_name)) {
igt_critical("Invalid dynamic subtest name \"%s\".\n",
@@ -1311,7 +1332,8 @@ bool igt_only_list_subtests(void)
void __igt_subtest_group_save(int *save, int *desc)
{
- assert(test_with_subtests);
+ internal_assert(test_with_subtests,
+ "igt_subtest_group is not allowed in igt_simple_main\n");
if (__current_description[0] != '\0') {
struct description_node *new = calloc(1, sizeof(*new));
@@ -1414,7 +1436,8 @@ void igt_skip(const char *f, ...)
va_list args;
skipped_one = true;
- assert(!test_child);
+ internal_assert(!test_child,
+ "skips are not allowed in forks\n");
if (!igt_only_list_subtests()) {
va_start(args, f);
@@ -1427,7 +1450,9 @@ void igt_skip(const char *f, ...)
exit_subtest("SKIP");
} else if (test_with_subtests) {
skip_subtests_henceforth = SKIP;
- assert(in_fixture);
+ internal_assert(in_fixture,
+ "skipping is allowed only in fixtures, subtests"
+ " or igt_simple_main\n");
__igt_fixture_end();
} else {
igt_exitcode = IGT_EXIT_SKIP;
@@ -1547,7 +1572,8 @@ void igt_fail(int exitcode)
if (in_subtest) {
exit_subtest("FAIL");
} else {
- assert(igt_can_fail());
+ internal_assert(igt_can_fail(), "failing test is only allowed"
+ " in fixtures, subtests and igt_simple_main");
if (in_fixture) {
skip_subtests_henceforth = FAIL;
@@ -1612,8 +1638,9 @@ void igt_describe_f(const char *fmt, ...)
int ret;
va_list args;
- if (in_subtest && _igt_dynamic_tests_executed >= 0)
- assert(!"Documenting dynamic subsubtests is impossible. Document the subtest instead.");
+ internal_assert(!in_subtest || _igt_dynamic_tests_executed < 0,
+ "Documenting dynamic subsubtests is impossible."
+ " Document the subtest instead.");
if (!describe_subtests)
return;
@@ -2224,8 +2251,10 @@ static void children_exit_handler(int sig)
bool __igt_fork(void)
{
- assert(!test_with_subtests || in_subtest);
- assert(!test_child);
+ internal_assert(!test_with_subtests || in_subtest,
+ "forking is only allowed in subtests or igt_simple_main\n");
+ internal_assert(!test_child,
+ "forking is not allowed from already forked children\n");
igt_install_exit_handler(children_exit_handler);
--
2.25.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [igt-dev] [PATCH i-g-t 2/3] lib/igt_core: Disallow nesting of igt_dynamic inside igt_dynamic
2020-05-04 11:26 [igt-dev] [PATCH i-g-t 1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Arkadiusz Hiler
@ 2020-05-04 11:26 ` Arkadiusz Hiler
2020-05-05 6:36 ` Petri Latvala
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 3/3] lib/tests: Add tests for magic control blocks nesting Arkadiusz Hiler
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Arkadiusz Hiler @ 2020-05-04 11:26 UTC (permalink / raw)
To: igt-dev
igt_dynamic is allowed only inside igt_subtest_with_dynamic
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
lib/igt_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 43f0ba8b..662a0986 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1280,6 +1280,8 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name)
{
internal_assert(in_subtest && _igt_dynamic_tests_executed >= 0,
"igt_dynamic is allowed only inside igt_subtest_with_dynamic\n");
+ internal_assert(!in_dynamic_subtest,
+ "igt_dynamic is not allowed to be nested in another igt_dynamic\n");
if (!valid_name_for_subtest(dynamic_subtest_name)) {
igt_critical("Invalid dynamic subtest name \"%s\".\n",
--
2.25.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [igt-dev] [PATCH i-g-t 3/3] lib/tests: Add tests for magic control blocks nesting
2020-05-04 11:26 [igt-dev] [PATCH i-g-t 1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Arkadiusz Hiler
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_core: Disallow nesting of igt_dynamic inside igt_dynamic Arkadiusz Hiler
@ 2020-05-04 11:26 ` Arkadiusz Hiler
2020-05-05 6:41 ` Petri Latvala
2020-05-04 12:15 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Patchwork
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Arkadiusz Hiler @ 2020-05-04 11:26 UTC (permalink / raw)
To: igt-dev; +Cc: Petri Latvala
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
lib/tests/igt_nesting.c | 261 +++++++++++++++++++++++++++++++++++
lib/tests/igt_tests_common.h | 5 +
lib/tests/meson.build | 1 +
3 files changed, 267 insertions(+)
create mode 100644 lib/tests/igt_nesting.c
diff --git a/lib/tests/igt_nesting.c b/lib/tests/igt_nesting.c
new file mode 100644
index 00000000..de674b6b
--- /dev/null
+++ b/lib/tests/igt_nesting.c
@@ -0,0 +1,261 @@
+/*
+ * Copyright © 2020 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include "igt_core.h"
+#include "igt_tests_common.h"
+#include "drmtest.h"
+
+char test[] = "test";
+char *fake_argv[] = { test };
+int fake_argc = ARRAY_SIZE(fake_argv);
+
+static void all_valid_simple_test(void)
+{
+ igt_simple_init(fake_argc, fake_argv);
+
+ igt_skip("o:");
+ igt_assert(false);
+
+ igt_exit();
+}
+
+static void all_valid(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_fixture {
+ }
+
+ igt_subtest_group {
+ igt_subtest_group {
+ }
+
+ igt_fixture {
+ }
+
+ igt_subtest("a")
+ {
+ igt_skip("o:\n");
+ }
+
+ igt_subtest("b")
+ {
+ igt_assert(false);
+ }
+
+ igt_subtest_with_dynamic("c") {
+ igt_dynamic("d")
+ {
+ igt_skip("o:\n");
+ }
+
+ igt_dynamic("e")
+ {
+ igt_assert(false);
+ }
+ }
+
+ igt_subtest_with_dynamic("f") {
+ igt_skip("o:\n");
+ }
+
+ igt_subtest_with_dynamic("g") {
+ }
+ }
+
+ igt_exit();
+}
+
+static void invalid_subtest_in_simple_test(void)
+{
+ igt_simple_init(fake_argc, fake_argv);
+
+ igt_subtest("a") {
+ }
+
+ igt_exit();
+}
+
+static void invalid_subtest_group_in_simple_test(void)
+{
+ igt_simple_init(fake_argc, fake_argv);
+
+ igt_subtest_group {
+ }
+
+ igt_exit();
+}
+
+static void invalid_subtest_with_dynamic_in_simple_test(void)
+{
+ igt_simple_init(fake_argc, fake_argv);
+
+ igt_subtest_with_dynamic("a") {
+ }
+
+ igt_exit();
+}
+
+static void invalid_dynamic_in_simple_test(void)
+{
+ igt_simple_init(fake_argc, fake_argv);
+
+ igt_dynamic("a") {
+ }
+
+ igt_exit();
+}
+
+static void invalid_fixture_in_fixture(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_fixture {
+ igt_fixture {
+ }
+ }
+
+ igt_exit();
+}
+
+static void invalid_subtest_in_subtest(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_subtest("a") {
+ igt_subtest("b") {
+ }
+ }
+
+ igt_exit();
+}
+
+static void invalid_top_level_dynamic(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_dynamic("a") {
+ }
+
+ igt_exit();
+}
+
+static void invalid_dynamic_in_regular_subtest(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_subtest("a") {
+ igt_dynamic("b") {
+ }
+ }
+
+ igt_exit();
+}
+
+static void invalid_fixture_in_subtest(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_subtest("a") {
+ igt_fixture {
+ }
+ }
+
+ igt_exit();
+}
+
+static void invalid_top_level_skip(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_skip("o:\n");
+
+ igt_exit();
+}
+
+static void invalid_top_level_assert(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_assert(false);
+
+ igt_exit();
+}
+
+static void invalid_dynamic_in_dynamic(void)
+{
+ igt_subtest_init(fake_argc, fake_argv);
+
+ igt_subtest_with_dynamic("a") {
+ igt_dynamic("b") {
+ igt_dynamic("c") {
+ }
+ }
+ }
+
+ igt_exit();
+}
+
+typedef void (*fork_fun)(void);
+
+int main(int argc, char **argv)
+{
+ int status;
+
+ /* test the invalid nesting scenarios */ {
+ fork_fun should_sigabort[] = {
+ invalid_subtest_in_simple_test,
+ invalid_subtest_group_in_simple_test,
+ invalid_subtest_with_dynamic_in_simple_test,
+ invalid_dynamic_in_simple_test,
+ invalid_fixture_in_fixture,
+ invalid_subtest_in_subtest,
+ invalid_top_level_dynamic,
+ invalid_dynamic_in_regular_subtest,
+ invalid_fixture_in_subtest,
+ invalid_top_level_skip,
+ invalid_top_level_assert,
+ invalid_dynamic_in_dynamic,
+ };
+
+ for (int i = 0; i < ARRAY_SIZE(should_sigabort); ++i) {
+ status = do_fork(should_sigabort[i]);
+ internal_assert_wsignaled(status, SIGABRT);
+ }
+ }
+
+ /* test the valid nesting scenarios */ {
+ fork_fun should_not_signal[] = {
+ all_valid_simple_test,
+ all_valid,
+ };
+
+ for (int i = 0; i < ARRAY_SIZE(should_not_signal); ++i) {
+ status = do_fork(should_not_signal[i]);
+ internal_assert_not_wsignaled(status);
+ }
+ }
+
+ return 0;
+}
diff --git a/lib/tests/igt_tests_common.h b/lib/tests/igt_tests_common.h
index f285d657..fa8ad920 100644
--- a/lib/tests/igt_tests_common.h
+++ b/lib/tests/igt_tests_common.h
@@ -51,6 +51,11 @@ static inline void internal_assert_wsignaled(int wstatus, int signal)
WTERMSIG(wstatus) == signal);
}
+static inline void internal_assert_not_wsignaled(int wstatus)
+{
+ internal_assert(!WIFSIGNALED(wstatus));
+}
+
static inline int do_fork(void (*test_to_run)(void))
{
int pid, status;
diff --git a/lib/tests/meson.build b/lib/tests/meson.build
index 22aa19da..47ef303a 100644
--- a/lib/tests/meson.build
+++ b/lib/tests/meson.build
@@ -12,6 +12,7 @@ lib_tests = [
'igt_fork_helper',
'igt_list_only',
'igt_invalid_subtest_name',
+ 'igt_nesting',
'igt_no_exit',
'igt_segfault',
'igt_simulation',
--
2.25.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose
2020-05-04 11:26 [igt-dev] [PATCH i-g-t 1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Arkadiusz Hiler
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_core: Disallow nesting of igt_dynamic inside igt_dynamic Arkadiusz Hiler
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 3/3] lib/tests: Add tests for magic control blocks nesting Arkadiusz Hiler
@ 2020-05-04 12:15 ` Patchwork
2020-05-04 21:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-05-05 6:36 ` [igt-dev] [PATCH i-g-t 1/3] " Petri Latvala
4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2020-05-04 12:15 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose
URL : https://patchwork.freedesktop.org/series/76900/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8417 -> IGTPW_4529
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/index.html
Known issues
------------
Here are the changes found in IGTPW_4529 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@gt_timelines:
- fi-bwr-2160: [PASS][1] -> [INCOMPLETE][2] ([i915#489])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/fi-bwr-2160/igt@i915_selftest@live@gt_timelines.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/fi-bwr-2160/igt@i915_selftest@live@gt_timelines.html
#### Warnings ####
* igt@i915_pm_rpm@module-reload:
- fi-kbl-x1275: [SKIP][3] ([fdo#109271]) -> [FAIL][4] ([i915#62])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/fi-kbl-x1275/igt@i915_pm_rpm@module-reload.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/fi-kbl-x1275/igt@i915_pm_rpm@module-reload.html
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#489]: https://gitlab.freedesktop.org/drm/intel/issues/489
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
Participating hosts (52 -> 44)
------------------------------
Missing (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-7560u fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_5628 -> IGTPW_4529
CI-20190529: 20190529
CI_DRM_8417: 7f9142d29c789842bd79245dd6623df9f15ba746 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_4529: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/index.html
IGT_5628: 652a3fd8966345fa5498904ce80a2027a6782783 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose
2020-05-04 11:26 [igt-dev] [PATCH i-g-t 1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Arkadiusz Hiler
` (2 preceding siblings ...)
2020-05-04 12:15 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Patchwork
@ 2020-05-04 21:33 ` Patchwork
2020-05-05 12:33 ` Arkadiusz Hiler
2020-05-05 6:36 ` [igt-dev] [PATCH i-g-t 1/3] " Petri Latvala
4 siblings, 1 reply; 10+ messages in thread
From: Patchwork @ 2020-05-04 21:33 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose
URL : https://patchwork.freedesktop.org/series/76900/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8417_full -> IGTPW_4529_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_4529_full absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_4529_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_4529_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_ctx_persistence@engines-hostile@bcs0:
- shard-kbl: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl7/igt@gem_ctx_persistence@engines-hostile@bcs0.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl6/igt@gem_ctx_persistence@engines-hostile@bcs0.html
Known issues
------------
Here are the changes found in IGTPW_4529_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_persistence@engines-hostile@bcs0:
- shard-iclb: [PASS][3] -> [FAIL][4] ([i915#1622])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-iclb5/igt@gem_ctx_persistence@engines-hostile@bcs0.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-iclb6/igt@gem_ctx_persistence@engines-hostile@bcs0.html
* igt@gem_eio@in-flight-suspend:
- shard-apl: [PASS][5] -> [DMESG-WARN][6] ([i915#180])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-apl8/igt@gem_eio@in-flight-suspend.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-apl6/igt@gem_eio@in-flight-suspend.html
* igt@gen9_exec_parse@allowed-all:
- shard-kbl: [PASS][7] -> [DMESG-WARN][8] ([i915#1436] / [i915#716])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl7/igt@gen9_exec_parse@allowed-all.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl3/igt@gen9_exec_parse@allowed-all.html
* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl: [PASS][9] -> [DMESG-WARN][10] ([i915#180]) +7 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl3/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
- shard-glk: [PASS][11] -> [FAIL][12] ([i915#72])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-glk6/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-glk9/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
* igt@kms_draw_crc@draw-method-rgb565-mmap-wc-untiled:
- shard-glk: [PASS][13] -> [FAIL][14] ([i915#52] / [i915#54]) +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-glk1/igt@kms_draw_crc@draw-method-rgb565-mmap-wc-untiled.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-glk2/igt@kms_draw_crc@draw-method-rgb565-mmap-wc-untiled.html
* igt@kms_mmap_write_crc@main:
- shard-kbl: [PASS][15] -> [FAIL][16] ([i915#93] / [i915#95])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl2/igt@kms_mmap_write_crc@main.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl7/igt@kms_mmap_write_crc@main.html
* igt@kms_pipe_crc_basic@read-crc-pipe-a:
- shard-apl: [PASS][17] -> [FAIL][18] ([i915#53] / [i915#95])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-apl3/igt@kms_pipe_crc_basic@read-crc-pipe-a.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-apl8/igt@kms_pipe_crc_basic@read-crc-pipe-a.html
- shard-kbl: [PASS][19] -> [FAIL][20] ([i915#53] / [i915#93] / [i915#95])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl2/igt@kms_pipe_crc_basic@read-crc-pipe-a.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl1/igt@kms_pipe_crc_basic@read-crc-pipe-a.html
* igt@kms_plane_cursor@pipe-a-overlay-size-64:
- shard-apl: [PASS][21] -> [FAIL][22] ([i915#1559] / [i915#95])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-apl2/igt@kms_plane_cursor@pipe-a-overlay-size-64.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-apl2/igt@kms_plane_cursor@pipe-a-overlay-size-64.html
* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [PASS][23] -> [SKIP][24] ([fdo#109441]) +2 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-iclb6/igt@kms_psr@psr2_primary_page_flip.html
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s0:
- shard-tglb: [INCOMPLETE][25] -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-tglb8/igt@gem_exec_suspend@basic-s0.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-tglb2/igt@gem_exec_suspend@basic-s0.html
* igt@kms_cursor_crc@pipe-a-cursor-128x42-random:
- shard-kbl: [FAIL][27] ([i915#54] / [i915#93] / [i915#95]) -> [PASS][28] +1 similar issue
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl3/igt@kms_cursor_crc@pipe-a-cursor-128x42-random.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl4/igt@kms_cursor_crc@pipe-a-cursor-128x42-random.html
* igt@kms_cursor_legacy@all-pipes-torture-move:
- shard-iclb: [DMESG-WARN][29] ([i915#128]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-iclb4/igt@kms_cursor_legacy@all-pipes-torture-move.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-iclb7/igt@kms_cursor_legacy@all-pipes-torture-move.html
* igt@kms_draw_crc@draw-method-rgb565-render-untiled:
- shard-glk: [FAIL][31] ([i915#52] / [i915#54]) -> [PASS][32] +5 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-glk9/igt@kms_draw_crc@draw-method-rgb565-render-untiled.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-glk6/igt@kms_draw_crc@draw-method-rgb565-render-untiled.html
* {igt@kms_flip@flip-vs-suspend-interruptible@c-dp1}:
- shard-apl: [DMESG-WARN][33] ([i915#180]) -> [PASS][34] +5 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-apl4/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-apl3/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html
* {igt@kms_flip@flip-vs-suspend-interruptible@c-hdmi-a1}:
- shard-hsw: [INCOMPLETE][35] ([i915#61]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-hsw4/igt@kms_flip@flip-vs-suspend-interruptible@c-hdmi-a1.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-hsw7/igt@kms_flip@flip-vs-suspend-interruptible@c-hdmi-a1.html
* {igt@kms_flip@flip-vs-suspend@a-dp1}:
- shard-kbl: [DMESG-WARN][37] ([i915#180] / [i915#93] / [i915#95]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl2/igt@kms_flip@flip-vs-suspend@a-dp1.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl3/igt@kms_flip@flip-vs-suspend@a-dp1.html
* {igt@kms_flip@flip-vs-suspend@c-dp1}:
- shard-kbl: [DMESG-WARN][39] ([i915#180]) -> [PASS][40] +1 similar issue
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl2/igt@kms_flip@flip-vs-suspend@c-dp1.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl3/igt@kms_flip@flip-vs-suspend@c-dp1.html
* igt@kms_flip_tiling@flip-changes-tiling-yf:
- shard-kbl: [FAIL][41] ([i915#699] / [i915#93] / [i915#95]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl3/igt@kms_flip_tiling@flip-changes-tiling-yf.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl4/igt@kms_flip_tiling@flip-changes-tiling-yf.html
- shard-apl: [FAIL][43] ([i915#95]) -> [PASS][44] +1 similar issue
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-apl8/igt@kms_flip_tiling@flip-changes-tiling-yf.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-apl6/igt@kms_flip_tiling@flip-changes-tiling-yf.html
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-apl: [FAIL][45] ([fdo#108145] / [i915#265] / [i915#95]) -> [PASS][46] +1 similar issue
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-apl8/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-apl2/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [SKIP][47] ([fdo#109441]) -> [PASS][48] +2 similar issues
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-iclb4/igt@kms_psr@psr2_primary_mmap_cpu.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
* {igt@perf@blocking-parameterized}:
- shard-iclb: [FAIL][49] ([i915#1542]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-iclb7/igt@perf@blocking-parameterized.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-iclb1/igt@perf@blocking-parameterized.html
#### Warnings ####
* igt@i915_pm_dc@dc3co-vpb-simulation:
- shard-iclb: [SKIP][51] ([i915#588]) -> [SKIP][52] ([i915#658])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-iclb2/igt@i915_pm_dc@dc3co-vpb-simulation.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-iclb6/igt@i915_pm_dc@dc3co-vpb-simulation.html
* igt@i915_pm_rpm@pm-tiling:
- shard-snb: [INCOMPLETE][53] ([i915#82]) -> [SKIP][54] ([fdo#109271])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-snb1/igt@i915_pm_rpm@pm-tiling.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-snb6/igt@i915_pm_rpm@pm-tiling.html
* igt@kms_content_protection@uevent:
- shard-kbl: [FAIL][55] ([i915#357] / [i915#93] / [i915#95]) -> [FAIL][56] ([i915#357])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl7/igt@kms_content_protection@uevent.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl3/igt@kms_content_protection@uevent.html
- shard-apl: [FAIL][57] ([i915#357] / [i915#95]) -> [FAIL][58] ([i915#357])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-apl2/igt@kms_content_protection@uevent.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-apl2/igt@kms_content_protection@uevent.html
* igt@kms_fbcon_fbt@fbc-suspend:
- shard-kbl: [FAIL][59] ([i915#93] / [i915#95]) -> [DMESG-FAIL][60] ([i915#180] / [i915#95])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl7/igt@kms_fbcon_fbt@fbc-suspend.html
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl4/igt@kms_fbcon_fbt@fbc-suspend.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
- shard-kbl: [DMESG-WARN][61] ([i915#180]) -> [INCOMPLETE][62] ([i915#155])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl4/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes.html
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl2/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[i915#128]: https://gitlab.freedesktop.org/drm/intel/issues/128
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
[i915#1559]: https://gitlab.freedesktop.org/drm/intel/issues/1559
[i915#1622]: https://gitlab.freedesktop.org/drm/intel/issues/1622
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#357]: https://gitlab.freedesktop.org/drm/intel/issues/357
[i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
[i915#53]: https://gitlab.freedesktop.org/drm/intel/issues/53
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#588]: https://gitlab.freedesktop.org/drm/intel/issues/588
[i915#61]: https://gitlab.freedesktop.org/drm/intel/issues/61
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#699]: https://gitlab.freedesktop.org/drm/intel/issues/699
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
[i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
[i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (10 -> 8)
------------------------------
Missing (2): pig-skl-6260u pig-glk-j5005
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_5628 -> IGTPW_4529
* Piglit: piglit_4509 -> None
CI-20190529: 20190529
CI_DRM_8417: 7f9142d29c789842bd79245dd6623df9f15ba746 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_4529: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/index.html
IGT_5628: 652a3fd8966345fa5498904ce80a2027a6782783 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose
2020-05-04 11:26 [igt-dev] [PATCH i-g-t 1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Arkadiusz Hiler
` (3 preceding siblings ...)
2020-05-04 21:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2020-05-05 6:36 ` Petri Latvala
4 siblings, 0 replies; 10+ messages in thread
From: Petri Latvala @ 2020-05-05 6:36 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: igt-dev
On Mon, May 04, 2020 at 02:26:21PM +0300, Arkadiusz Hiler wrote:
> Instead of ending the execution with cryptic assert let's actually print
> a message explaining the reason and point towards igt_core's documentation.
>
> I am sticking with assert() instead of abort() because of the
> semi-useful stacktraces it produces.
>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
> lib/igt_core.c | 55 ++++++++++++++++++++++++++++++++++++++------------
> 1 file changed, 42 insertions(+), 13 deletions(-)
>
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 3f7b9f68..43f0ba8b 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -343,6 +343,21 @@ static bool stderr_needs_sentinel = false;
>
> static int _igt_dynamic_tests_executed = -1;
>
> +__attribute__((format(printf, 2, 3)))
> +static void internal_assert(bool cond, const char *format, ...)
> +{
> + if (!cond) {
> + va_list ap;
> +
> + va_start(ap, format);
> + vfprintf(stderr, format, ap);
> + va_end(ap);
> + fprintf(stderr, "please refer to lib/igt_core documentation\n");
> +
> + assert(0);
> + }
> +}
> +
> const char *igt_test_name(void)
> {
> return command_str;
> @@ -540,8 +555,12 @@ uint64_t igt_nsec_elapsed(struct timespec *start)
>
> bool __igt_fixture(void)
> {
> - assert(!in_fixture);
> - assert(test_with_subtests);
> + internal_assert(!in_fixture,
> + "nesting multiple igt_fixtures is invalid\n");
> + internal_assert(!in_subtest,
> + "nesting igt_fixture in igt_subtest is invalid\n");
> + internal_assert(test_with_subtests,
> + "igt_fixture in igt_simple_main is invalid\n");
>
> if (igt_only_list_subtests())
> return false;
> @@ -1202,7 +1221,9 @@ static bool valid_name_for_subtest(const char *subtest_name)
> */
> bool __igt_run_subtest(const char *subtest_name, const char *file, const int line)
> {
> - assert(!igt_can_fail());
> + internal_assert(!igt_can_fail(),
> + "igt_subtest can be nested only in igt_main"
> + " or igt_subtest_group\n");
>
> if (!valid_name_for_subtest(subtest_name)) {
> igt_critical("Invalid subtest name \"%s\".\n",
> @@ -1257,8 +1278,8 @@ bool __igt_run_subtest(const char *subtest_name, const char *file, const int lin
>
> bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name)
> {
> - assert(in_subtest);
> - assert(_igt_dynamic_tests_executed >= 0);
> + internal_assert(in_subtest && _igt_dynamic_tests_executed >= 0,
> + "igt_dynamic is allowed only inside igt_subtest_with_dynamic\n");
>
> if (!valid_name_for_subtest(dynamic_subtest_name)) {
> igt_critical("Invalid dynamic subtest name \"%s\".\n",
> @@ -1311,7 +1332,8 @@ bool igt_only_list_subtests(void)
>
> void __igt_subtest_group_save(int *save, int *desc)
> {
> - assert(test_with_subtests);
> + internal_assert(test_with_subtests,
> + "igt_subtest_group is not allowed in igt_simple_main\n");
>
> if (__current_description[0] != '\0') {
> struct description_node *new = calloc(1, sizeof(*new));
> @@ -1414,7 +1436,8 @@ void igt_skip(const char *f, ...)
> va_list args;
> skipped_one = true;
>
> - assert(!test_child);
> + internal_assert(!test_child,
> + "skips are not allowed in forks\n");
>
> if (!igt_only_list_subtests()) {
> va_start(args, f);
> @@ -1427,7 +1450,9 @@ void igt_skip(const char *f, ...)
> exit_subtest("SKIP");
> } else if (test_with_subtests) {
> skip_subtests_henceforth = SKIP;
> - assert(in_fixture);
> + internal_assert(in_fixture,
> + "skipping is allowed only in fixtures, subtests"
> + " or igt_simple_main\n");
> __igt_fixture_end();
> } else {
> igt_exitcode = IGT_EXIT_SKIP;
> @@ -1547,7 +1572,8 @@ void igt_fail(int exitcode)
> if (in_subtest) {
> exit_subtest("FAIL");
> } else {
> - assert(igt_can_fail());
> + internal_assert(igt_can_fail(), "failing test is only allowed"
> + " in fixtures, subtests and igt_simple_main");
>
> if (in_fixture) {
> skip_subtests_henceforth = FAIL;
> @@ -1612,8 +1638,9 @@ void igt_describe_f(const char *fmt, ...)
> int ret;
> va_list args;
>
> - if (in_subtest && _igt_dynamic_tests_executed >= 0)
> - assert(!"Documenting dynamic subsubtests is impossible. Document the subtest instead.");
> + internal_assert(!in_subtest || _igt_dynamic_tests_executed < 0,
> + "Documenting dynamic subsubtests is impossible."
> + " Document the subtest instead.");
This is the only internal_assert call with capitalized text.
With more consistency applied,
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
>
> if (!describe_subtests)
> return;
> @@ -2224,8 +2251,10 @@ static void children_exit_handler(int sig)
>
> bool __igt_fork(void)
> {
> - assert(!test_with_subtests || in_subtest);
> - assert(!test_child);
> + internal_assert(!test_with_subtests || in_subtest,
> + "forking is only allowed in subtests or igt_simple_main\n");
> + internal_assert(!test_child,
> + "forking is not allowed from already forked children\n");
>
> igt_install_exit_handler(children_exit_handler);
>
> --
> 2.25.2
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/3] lib/igt_core: Disallow nesting of igt_dynamic inside igt_dynamic
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_core: Disallow nesting of igt_dynamic inside igt_dynamic Arkadiusz Hiler
@ 2020-05-05 6:36 ` Petri Latvala
0 siblings, 0 replies; 10+ messages in thread
From: Petri Latvala @ 2020-05-05 6:36 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: igt-dev
On Mon, May 04, 2020 at 02:26:22PM +0300, Arkadiusz Hiler wrote:
> igt_dynamic is allowed only inside igt_subtest_with_dynamic
>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> ---
> lib/igt_core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 43f0ba8b..662a0986 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -1280,6 +1280,8 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name)
> {
> internal_assert(in_subtest && _igt_dynamic_tests_executed >= 0,
> "igt_dynamic is allowed only inside igt_subtest_with_dynamic\n");
> + internal_assert(!in_dynamic_subtest,
> + "igt_dynamic is not allowed to be nested in another igt_dynamic\n");
>
> if (!valid_name_for_subtest(dynamic_subtest_name)) {
> igt_critical("Invalid dynamic subtest name \"%s\".\n",
> --
> 2.25.2
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 3/3] lib/tests: Add tests for magic control blocks nesting
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 3/3] lib/tests: Add tests for magic control blocks nesting Arkadiusz Hiler
@ 2020-05-05 6:41 ` Petri Latvala
2020-05-05 12:32 ` Arkadiusz Hiler
0 siblings, 1 reply; 10+ messages in thread
From: Petri Latvala @ 2020-05-05 6:41 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: igt-dev
On Mon, May 04, 2020 at 02:26:23PM +0300, Arkadiusz Hiler wrote:
> Cc: Petri Latvala <petri.latvala@intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Is igt_fork usage covered elsewhere?
> ---
> lib/tests/igt_nesting.c | 261 +++++++++++++++++++++++++++++++++++
> lib/tests/igt_tests_common.h | 5 +
> lib/tests/meson.build | 1 +
> 3 files changed, 267 insertions(+)
> create mode 100644 lib/tests/igt_nesting.c
>
> diff --git a/lib/tests/igt_nesting.c b/lib/tests/igt_nesting.c
> new file mode 100644
> index 00000000..de674b6b
> --- /dev/null
> +++ b/lib/tests/igt_nesting.c
> @@ -0,0 +1,261 @@
> +/*
> + * Copyright © 2020 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include "igt_core.h"
> +#include "igt_tests_common.h"
> +#include "drmtest.h"
> +
> +char test[] = "test";
> +char *fake_argv[] = { test };
> +int fake_argc = ARRAY_SIZE(fake_argv);
> +
> +static void all_valid_simple_test(void)
> +{
> + igt_simple_init(fake_argc, fake_argv);
> +
> + igt_skip("o:");
> + igt_assert(false);
> +
> + igt_exit();
> +}
> +
> +static void all_valid(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_fixture {
> + }
> +
> + igt_subtest_group {
> + igt_subtest_group {
> + }
> +
> + igt_fixture {
> + }
> +
> + igt_subtest("a")
> + {
> + igt_skip("o:\n");
> + }
> +
> + igt_subtest("b")
> + {
> + igt_assert(false);
> + }
> +
> + igt_subtest_with_dynamic("c") {
> + igt_dynamic("d")
> + {
> + igt_skip("o:\n");
> + }
> +
> + igt_dynamic("e")
> + {
> + igt_assert(false);
> + }
> + }
> +
> + igt_subtest_with_dynamic("f") {
> + igt_skip("o:\n");
> + }
> +
> + igt_subtest_with_dynamic("g") {
> + }
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_subtest_in_simple_test(void)
> +{
> + igt_simple_init(fake_argc, fake_argv);
> +
> + igt_subtest("a") {
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_subtest_group_in_simple_test(void)
> +{
> + igt_simple_init(fake_argc, fake_argv);
> +
> + igt_subtest_group {
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_subtest_with_dynamic_in_simple_test(void)
> +{
> + igt_simple_init(fake_argc, fake_argv);
> +
> + igt_subtest_with_dynamic("a") {
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_dynamic_in_simple_test(void)
> +{
> + igt_simple_init(fake_argc, fake_argv);
> +
> + igt_dynamic("a") {
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_fixture_in_fixture(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_fixture {
> + igt_fixture {
> + }
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_subtest_in_subtest(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_subtest("a") {
> + igt_subtest("b") {
> + }
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_top_level_dynamic(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_dynamic("a") {
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_dynamic_in_regular_subtest(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_subtest("a") {
> + igt_dynamic("b") {
> + }
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_fixture_in_subtest(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_subtest("a") {
> + igt_fixture {
> + }
> + }
> +
> + igt_exit();
> +}
> +
> +static void invalid_top_level_skip(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_skip("o:\n");
> +
> + igt_exit();
> +}
> +
> +static void invalid_top_level_assert(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_assert(false);
> +
> + igt_exit();
> +}
> +
> +static void invalid_dynamic_in_dynamic(void)
> +{
> + igt_subtest_init(fake_argc, fake_argv);
> +
> + igt_subtest_with_dynamic("a") {
> + igt_dynamic("b") {
> + igt_dynamic("c") {
> + }
> + }
> + }
> +
> + igt_exit();
> +}
> +
> +typedef void (*fork_fun)(void);
> +
> +int main(int argc, char **argv)
> +{
> + int status;
> +
> + /* test the invalid nesting scenarios */ {
> + fork_fun should_sigabort[] = {
> + invalid_subtest_in_simple_test,
> + invalid_subtest_group_in_simple_test,
> + invalid_subtest_with_dynamic_in_simple_test,
> + invalid_dynamic_in_simple_test,
> + invalid_fixture_in_fixture,
> + invalid_subtest_in_subtest,
> + invalid_top_level_dynamic,
> + invalid_dynamic_in_regular_subtest,
> + invalid_fixture_in_subtest,
> + invalid_top_level_skip,
> + invalid_top_level_assert,
> + invalid_dynamic_in_dynamic,
> + };
> +
> + for (int i = 0; i < ARRAY_SIZE(should_sigabort); ++i) {
> + status = do_fork(should_sigabort[i]);
> + internal_assert_wsignaled(status, SIGABRT);
> + }
> + }
> +
> + /* test the valid nesting scenarios */ {
> + fork_fun should_not_signal[] = {
> + all_valid_simple_test,
> + all_valid,
> + };
> +
> + for (int i = 0; i < ARRAY_SIZE(should_not_signal); ++i) {
> + status = do_fork(should_not_signal[i]);
> + internal_assert_not_wsignaled(status);
> + }
> + }
> +
> + return 0;
> +}
> diff --git a/lib/tests/igt_tests_common.h b/lib/tests/igt_tests_common.h
> index f285d657..fa8ad920 100644
> --- a/lib/tests/igt_tests_common.h
> +++ b/lib/tests/igt_tests_common.h
> @@ -51,6 +51,11 @@ static inline void internal_assert_wsignaled(int wstatus, int signal)
> WTERMSIG(wstatus) == signal);
> }
>
> +static inline void internal_assert_not_wsignaled(int wstatus)
> +{
> + internal_assert(!WIFSIGNALED(wstatus));
> +}
> +
> static inline int do_fork(void (*test_to_run)(void))
> {
> int pid, status;
> diff --git a/lib/tests/meson.build b/lib/tests/meson.build
> index 22aa19da..47ef303a 100644
> --- a/lib/tests/meson.build
> +++ b/lib/tests/meson.build
> @@ -12,6 +12,7 @@ lib_tests = [
> 'igt_fork_helper',
> 'igt_list_only',
> 'igt_invalid_subtest_name',
> + 'igt_nesting',
> 'igt_no_exit',
> 'igt_segfault',
> 'igt_simulation',
> --
> 2.25.2
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 3/3] lib/tests: Add tests for magic control blocks nesting
2020-05-05 6:41 ` Petri Latvala
@ 2020-05-05 12:32 ` Arkadiusz Hiler
0 siblings, 0 replies; 10+ messages in thread
From: Arkadiusz Hiler @ 2020-05-05 12:32 UTC (permalink / raw)
To: Petri Latvala; +Cc: igt-dev
On Tue, May 05, 2020 at 09:41:02AM +0300, Petri Latvala wrote:
> On Mon, May 04, 2020 at 02:26:23PM +0300, Arkadiusz Hiler wrote:
> > Cc: Petri Latvala <petri.latvala@intel.com>
> > Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
>
>
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
>
> Is igt_fork usage covered elsewhere?
There are some tests in lib/test/, but not for nesting.
We can add them here. I'll try to do that today.
I have addressed your comment on the messages consistency and merged the
patches.
--
Cheers,
Arek
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose
2020-05-04 21:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2020-05-05 12:33 ` Arkadiusz Hiler
0 siblings, 0 replies; 10+ messages in thread
From: Arkadiusz Hiler @ 2020-05-05 12:33 UTC (permalink / raw)
To: igt-dev; +Cc: Lakshmi
On Mon, May 04, 2020 at 09:33:52PM +0000, Patchwork wrote:
> == Series Details ==
>
> Series: series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose
> URL : https://patchwork.freedesktop.org/series/76900/
> State : failure
>
> == Summary ==
>
> CI Bug Log - changes from CI_DRM_8417_full -> IGTPW_4529_full
> ====================================================
>
> Summary
> -------
>
> **FAILURE**
>
> Serious unknown changes coming with IGTPW_4529_full absolutely need to be
> verified manually.
>
> If you think the reported changes have nothing to do with the changes
> introduced in IGTPW_4529_full, please notify your bug team to allow them
> to document this new failure mode, which will reduce false positives in CI.
>
> External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/index.html
>
> Possible new issues
> -------------------
>
> Here are the unknown changes that may have been introduced in IGTPW_4529_full:
>
> ### IGT changes ###
>
> #### Possible regressions ####
>
> * igt@gem_ctx_persistence@engines-hostile@bcs0:
> - shard-kbl: [PASS][1] -> [FAIL][2]
> [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8417/shard-kbl7/igt@gem_ctx_persistence@engines-hostile@bcs0.html
> [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4529/shard-kbl6/igt@gem_ctx_persistence@engines-hostile@bcs0.html
Unrelated GEM failure. No need for re-reporting, the patch is already merged.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-05-05 12:33 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 11:26 [igt-dev] [PATCH i-g-t 1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Arkadiusz Hiler
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_core: Disallow nesting of igt_dynamic inside igt_dynamic Arkadiusz Hiler
2020-05-05 6:36 ` Petri Latvala
2020-05-04 11:26 ` [igt-dev] [PATCH i-g-t 3/3] lib/tests: Add tests for magic control blocks nesting Arkadiusz Hiler
2020-05-05 6:41 ` Petri Latvala
2020-05-05 12:32 ` Arkadiusz Hiler
2020-05-04 12:15 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib/igt_core: Make assert on invalid magic blocks nesting more verbose Patchwork
2020-05-04 21:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-05-05 12:33 ` Arkadiusz Hiler
2020-05-05 6:36 ` [igt-dev] [PATCH i-g-t 1/3] " Petri Latvala
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.